fix(login): redirect to dashboard after successful login
This commit is contained in:
+1
-2
@@ -145,8 +145,7 @@ class ApiClient {
|
|||||||
// Keep failed login attempts on the same page.
|
// Keep failed login attempts on the same page.
|
||||||
// Only force logout for JWT-protected API v1 requests.
|
// Only force logout for JWT-protected API v1 requests.
|
||||||
if (isV1APIRequest && !isLoginRequest && !isLoginPage) {
|
if (isV1APIRequest && !isLoginRequest && !isLoginPage) {
|
||||||
// Token expired or invalid, clear auth and redirect.
|
this.clearAuth();
|
||||||
//this.clearAuth();
|
|
||||||
window.location.href = LOGIN_UI_PATH;
|
window.location.href = LOGIN_UI_PATH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default function LoginPage() {
|
|||||||
message: 'Welcome back!',
|
message: 'Welcome back!',
|
||||||
color: 'green',
|
color: 'green',
|
||||||
});
|
});
|
||||||
navigate('/');
|
navigate('/dashboard');
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
const responseData = err?.response?.data;
|
const responseData = err?.response?.data;
|
||||||
const notificationMessage =
|
const notificationMessage =
|
||||||
|
|||||||
Reference in New Issue
Block a user