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:
MananTank
2024-09-05 15:26:16 +00:00
parent fa6809d500
commit dc3849334d
-5
View File
@@ -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("/");