feature: remove change password for admin
This commit is contained in:
@@ -62,7 +62,7 @@ class AuthController extends Controller
|
||||
\Illuminate\Support\Facades\RateLimiter::clear($throttleKey);
|
||||
|
||||
$user = $result['user'];
|
||||
if ($user->first_login == \App\Models\User::FIRST_LOGIN_TRUE) {
|
||||
if ($user->role != \App\Models\User::ROLE_ADMIN && $user->first_login == \App\Models\User::FIRST_LOGIN_TRUE) {
|
||||
return redirect()->route('login')->with('dialog_first_login', true);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class ForceChangePasswordMiddleware
|
||||
{
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (Auth::check() && Auth::user()->first_login == User::FIRST_LOGIN_TRUE) {
|
||||
if (Auth::check() && Auth::user()->role != User::ROLE_ADMIN && Auth::user()->first_login == User::FIRST_LOGIN_TRUE) {
|
||||
if (!$request->routeIs('user.change_password') && !$request->routeIs('user.update_password') && !$request->routeIs('logout')) {
|
||||
return redirect()->route('user.change_password');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user