change user checkIsNormal()

This commit is contained in:
xiaomlove
2025-05-05 22:07:14 +07:00
parent c5c20c02d6
commit 9a3daabf18
4 changed files with 12 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
<?php
namespace App\Auth;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Auth\GuardHelpers;
use Illuminate\Contracts\Auth\Authenticatable;
@@ -46,14 +47,16 @@ class NexusWebGuard implements StatefulGuard
}
$credentials = $this->request->cookie();
if ($this->validate($credentials)) {
/**
* @var User $user
*/
$user = $this->provider->retrieveByCredentials($credentials);
if (empty($user)) {
return null;
}
if ($this->provider->validateCredentials($user, $credentials)) {
if ($user->checkIsNormal()) {
return $this->user = $user;
}
$user->checkIsNormal();
return $this->user = $user;
}
}
}