feat: Implement client status validation on login, refine password rules, and simplify customer resource status.

This commit is contained in:
pbao9
2026-03-10 16:27:23 +07:00
parent cf0f2cf686
commit 7fdcc01027
18 changed files with 831 additions and 12 deletions
@@ -29,6 +29,19 @@ class ClientAuthService
$client = Auth::guard('client')->user();
if ((int)$client->status !== 1) {
$statusLabel = match ((int)$client->status) {
0 => 'chờ xác thực',
2 => 'tạm ngưng hoạt động',
3 => 'bị khoá',
default => 'vô hiệu hoá',
};
throw ValidationException::withMessages([
'email' => ["Tài khoản của bạn đã {$statusLabel}, vui lòng liên hệ hotline."],
]);
}
return [
'client' => $client,
'token' => $token,