0
Fork 0
mirror of https://github.com/stonith404/pingvin-share.git synced 2025-01-29 01:28:59 -05:00

fix: non administrator user redirection error while setup isn't finished

This commit is contained in:
Elias Schneider 2023-02-11 15:57:21 +01:00
parent 979b882150
commit dc8cf3d5ca
No known key found for this signature in database
GPG key ID: 07E623B294202B6C

View file

@ -70,8 +70,8 @@ export async function middleware(request: NextRequest) {
path: "/auth/signUp",
},
{
condition: getConfig("SETUP_STATUS") == "REGISTERED" && !routes.setupStatusRegistered.contains(route),
path: user ? "/admin/setup" : "/auth/signIn",
condition: getConfig("SETUP_STATUS") == "REGISTERED" && !routes.setupStatusRegistered.contains(route) && user?.isAdmin,
path: "/admin/setup",
},
// Authenticated state
{