fix: resolve redirect loop after login
- Update middleware to use getAll/setAll cookie methods for better session handling - Replace router.push with window.location.href for full page reload - This ensures middleware properly detects authenticated session
This commit is contained in:
@@ -43,8 +43,8 @@ export default function LoginPage() {
|
||||
throw new Error("Not authorized as admin");
|
||||
}
|
||||
|
||||
router.push("/");
|
||||
router.refresh();
|
||||
// Force a full page reload to ensure middleware picks up the session
|
||||
window.location.href = "/";
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : "Login failed");
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user