Fix user stuck in logged out state in dashboard (#4421)
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR removes a redirect logic for the "/login" path and updates path splitting logic in `middleware.ts`.
### Detailed summary
- Removed redirect logic for "/login" path
- Updated path splitting logic in `middleware.ts`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
This commit is contained in:
@@ -41,11 +41,6 @@ export async function middleware(request: NextRequest) {
|
||||
);
|
||||
}
|
||||
}
|
||||
// /login redirect
|
||||
if (pathname === "/login" && authCookie) {
|
||||
// if the user is logged in, redirect to dashboard
|
||||
return redirect(request, "/dashboard");
|
||||
}
|
||||
|
||||
// remove '/' in front and then split by '/'
|
||||
const paths = pathname.slice(1).split("/");
|
||||
|
||||
Reference in New Issue
Block a user