restcontroller: auth :fix user nullpointer
add missing parameter to cutler env
This commit is contained in:
parent
eca459cb65
commit
bf5a1f34ab
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
$REST_ALLOW_VERIFY_ONLY=getenv('FITNESS_REST_ALLOW_VERIFY_ONLY');
|
||||
|
||||
return [
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'company' => 'gyor',//gyor
|
||||
@ -20,5 +22,6 @@ return [
|
||||
'reception_transfer_list_only_today' => true,
|
||||
'reception_show_stock' => false,
|
||||
'login_admin_email' => false,
|
||||
'warn_ticket_expire_in_usage_count' => 10
|
||||
'warn_ticket_expire_in_usage_count' => 10,
|
||||
'rest_allow_verify_only' => $REST_ALLOW_VERIFY_ONLY === 'true'
|
||||
];
|
||||
|
||||
@ -24,12 +24,19 @@ class RestController extends Controller
|
||||
{
|
||||
try {
|
||||
$user = User::findOne(['username' => $username]);
|
||||
|
||||
if ( !isset($user ) ){
|
||||
\Yii::error("User not found: ".$username);
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($user->validatePassword($password)) {
|
||||
return $user;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
\Yii::error("Failed to load user: " . $e->getMessage());
|
||||
\Yii::error("Failed to load user $username: " . $e->getMessage());
|
||||
}
|
||||
\Yii::error("User not found: ".$username);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user