feature: update message for login feature
This commit is contained in:
@@ -14,7 +14,7 @@ class AuthService implements AuthServiceInterface
|
||||
// Manual MD5 password check
|
||||
$user = User::where('mail', $credentials['mail'])->first();
|
||||
if (!$user || $user->pass !== md5($credentials['password'])) {
|
||||
return ['success' => false, 'error_key' => 'mail', 'error_msg' => __('auth.failed')];
|
||||
return ['success' => false, 'error_key' => 'mail', 'error_msg' => 'Thông tin đăng nhập không đúng. Vui lòng nhập lại'];
|
||||
}
|
||||
|
||||
// Log the user in manually
|
||||
@@ -22,7 +22,7 @@ class AuthService implements AuthServiceInterface
|
||||
$request->session()->regenerate();
|
||||
if ($user->status != User::STATUS_ACTIVE) {
|
||||
Auth::logout();
|
||||
return ['success' => false, 'error_key' => 'mail', 'error_msg' => __('auth.inactive')];
|
||||
return ['success' => false, 'error_key' => 'permission', 'error_msg' => 'Bạn không có quyền truy cập. Vui lòng liên hệ quản trị viên'];
|
||||
}
|
||||
|
||||
return ['success' => true, 'user' => $user];
|
||||
@@ -41,6 +41,10 @@ class AuthService implements AuthServiceInterface
|
||||
return route('user.change_password');
|
||||
}
|
||||
|
||||
if ($user->role == User::ROLE_ADMIN) {
|
||||
return route('admin.dashboard');
|
||||
}
|
||||
|
||||
return route('user.dashboard');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user