|
|
@@ -39,7 +39,8 @@ export default function Login() {
|
|
|
onSuccess: () => {
|
|
|
// Redirect to dashboard after login
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
|
- const returnTo = params.get("returnTo") || "/dashboard";
|
|
|
+ const base = import.meta.env.BASE_URL ?? "/";
|
|
|
+ const returnTo = params.get("returnTo") || `${base}dashboard`;
|
|
|
window.location.href = returnTo;
|
|
|
},
|
|
|
onError: (err) => {
|
|
|
@@ -49,7 +50,7 @@ export default function Login() {
|
|
|
|
|
|
// Redirect if already logged in
|
|
|
if (!authLoading && isAuthenticated) {
|
|
|
- window.location.href = "/dashboard";
|
|
|
+ window.location.href = `${import.meta.env.BASE_URL ?? "/"}dashboard`;
|
|
|
return null;
|
|
|
}
|
|
|
|