Updated sidebar layout (#1661)

This commit is contained in:
Luke Vella 2025-04-14 15:11:59 +01:00 committed by GitHub
parent 8c0814b92b
commit 72ca1d4c38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
104 changed files with 3268 additions and 1331 deletions

View file

@ -12,9 +12,12 @@ export const middleware = withAuth(async (req) => {
const newUrl = nextUrl.clone();
const isLoggedIn = req.auth?.user?.email;
// if the user is already logged in, don't let them access the login page
if (/^\/(login)/.test(newUrl.pathname) && isLoggedIn) {
if (
/^\/(login)/.test(newUrl.pathname) &&
isLoggedIn &&
!newUrl.searchParams.get("invalidSession")
) {
newUrl.pathname = "/";
return NextResponse.redirect(newUrl);
}