fix bug login & delete
This commit is contained in:
@@ -49,16 +49,16 @@ class LoginController extends Controller
|
||||
// Check the current guard and redirect accordingly
|
||||
if (Auth::guard('admin')->check()) {
|
||||
// Redirect admins to their dashboard
|
||||
return route('admin.dashboard');
|
||||
return '/';
|
||||
}
|
||||
|
||||
if (Auth::guard('web')->check()) {
|
||||
// Redirect regular users to their home or default page
|
||||
return route('trx_order_elevation.index');
|
||||
return '/';
|
||||
}
|
||||
|
||||
// Default redirection if no condition matches
|
||||
return '/admin/login';
|
||||
return '/login';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,11 +104,14 @@ class LoginController extends Controller
|
||||
|
||||
AuditTrailHelper::AuthAttempt('Login', 'User (' . $request->email . ') Logged in to the System');
|
||||
return redirect($redirectTo);
|
||||
} else {
|
||||
// Log activity
|
||||
AuditTrailHelper::AuthAttempt('Login', 'Failed login attempt for User (' . $request->email . ')');
|
||||
|
||||
// Login failed
|
||||
session()->flash('error', 'Invalid email or password.');
|
||||
return back();
|
||||
}
|
||||
|
||||
// Login failed
|
||||
session()->flash('error', 'Invalid email or password.');
|
||||
return back();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user