feat: Implement client status validation on login, refine password rules, and simplify customer resource status.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user