I
I
Ilya Beloborodov2019-05-30 09:07:59
Yii
Ilya Beloborodov, 2019-05-30 09:07:59

Yii\web\User how does access token work?

I updated in the User accessToken table. Now the password is always wrong when logging in. Can anyone explain how it works? And can it be changed from time to time?
my secret code

public function actionLogin()
    {
        $this->layout = '@app/views/layouts/auth';

        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new User();

        if ($model->load(Yii::$app->request->post()) && $model->login()) {
            return $this->goBack(Yii::$app->request->get('back'));
        }

        $model->password = '';
        return $this->render('login', [
            'model' => $model,
        ]);
    }

app\modes\User::login
public function login()
    {
        if ($this->validate()) {
            return Yii::$app->user->login(self::findByUser($this->username));
        }
        return false;
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Kazantsev, 2017-06-15
@lemonlimelike

But just on the output on the site it is impossible to show articles whose posting time is less than the present time?

E
ebanytiu_lis, 2017-06-15
@ebanytiu_lis

You can write a script that takes articles from the database and posts them to the site.
And run it through Cron...
For example, here:
https://cron-job.org/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question