Formatting

This commit is contained in:
2025-05-13 09:28:44 -05:00
parent 6b667c2dad
commit a2f61ece94
15 changed files with 101 additions and 111 deletions

View File

@ -1,5 +1,5 @@
import { createServerClient } from "@supabase/ssr";
import { type NextRequest, NextResponse } from "next/server";
import { createServerClient } from '@supabase/ssr';
import { type NextRequest, NextResponse } from 'next/server';
export const updateSession = async (request: NextRequest) => {
// This `try/catch` block is only here for the interactive tutorial.
@ -40,12 +40,12 @@ export const updateSession = async (request: NextRequest) => {
const user = await supabase.auth.getUser();
// protected routes
if (request.nextUrl.pathname.startsWith("/protected") && user.error) {
return NextResponse.redirect(new URL("/sign-in", request.url));
if (request.nextUrl.pathname.startsWith('/protected') && 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;