Browse Source

Docs enhancements (#18985)

- added more strict checks in if condition: that if `$user` exists, only then call its method
 - Renamed `verifyPassword` to `validatePassword` because yii2-advanced-template use that method name
tags/2.0.44
Sohel Ahmed Mesaniya 3 years ago committed by GitHub
parent
commit
4b3361bf02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      framework/filters/auth/HttpBasicAuth.php

2
framework/filters/auth/HttpBasicAuth.php

@ -37,7 +37,7 @@ namespace yii\filters\auth;
* 'class' => \yii\filters\auth\HttpBasicAuth::class,
* 'auth' => function ($username, $password) {
* $user = User::find()->where(['username' => $username])->one();
* if ($user->verifyPassword($password)) {
* if ($user && $user->validatePassword($password)) {
* return $user;
* }
* return null;

Loading…
Cancel
Save