mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-20 17:57:22 +02:00
✨ Updated sidebar layout (#1661)
This commit is contained in:
parent
8c0814b92b
commit
72ca1d4c38
104 changed files with 3268 additions and 1331 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue