Cleaning up
This commit is contained in:
@@ -41,13 +41,13 @@ export const updateSession = async (request: NextRequest) => {
|
||||
const user = await supabase.auth.getUser();
|
||||
|
||||
// protected routes
|
||||
if (request.nextUrl.pathname.startsWith('/protected') && user.error) {
|
||||
if (request.nextUrl.pathname.startsWith('/reset-password') && user.error) {
|
||||
return NextResponse.redirect(new URL('/sign-in', request.url));
|
||||
}
|
||||
|
||||
if (request.nextUrl.pathname === '/' && !user.error) {
|
||||
return NextResponse.redirect(new URL('/protected', request.url));
|
||||
}
|
||||
//if (request.nextUrl.pathname === '/' && !user.error) {
|
||||
//return NextResponse.redirect(new URL('/protected', request.url));
|
||||
//}
|
||||
|
||||
return response;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user