админка

This commit is contained in:
2026-03-13 23:33:35 +04:00
parent bae063a4fa
commit eaedeeb52b
41 changed files with 2506 additions and 67 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
namespace App\Auth;
use App\Models\GameAccountUser;
use App\Services\AzerothCoreAccountService;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\Auth\UserProvider;
class AzerothCoreUserProvider implements UserProvider
{
public function __construct(private readonly AzerothCoreAccountService $accounts)
{
}
public function retrieveById($identifier): ?Authenticatable
{
if (! is_numeric($identifier)) {
return null;
}
return $this->accounts->findUserById((int) $identifier);
}
public function retrieveByToken($identifier, #[\SensitiveParameter] $token): ?Authenticatable
{
return null;
}
public function updateRememberToken(Authenticatable $user, #[\SensitiveParameter] $token): void
{
}
public function retrieveByCredentials(#[\SensitiveParameter] array $credentials): ?Authenticatable
{
$username = $credentials['username'] ?? null;
if (! is_string($username) || trim($username) === '') {
return null;
}
return $this->accounts->findUserByUsername($username);
}
public function validateCredentials(Authenticatable $user, #[\SensitiveParameter] array $credentials): bool
{
return $user instanceof GameAccountUser
&& isset($credentials['password'])
&& is_string($credentials['password'])
&& $this->accounts->validatePassword($user, $credentials['password']);
}
public function rehashPasswordIfRequired(Authenticatable $user, #[\SensitiveParameter] array $credentials, bool $force = false): void
{
}
}