diff --git a/measure-web-app/app/auth/logout/route.ts b/measure-web-app/app/auth/logout/route.ts index 12b3c2717..4929c13ae 100644 --- a/measure-web-app/app/auth/logout/route.ts +++ b/measure-web-app/app/auth/logout/route.ts @@ -1,5 +1,5 @@ import { createClient } from '@/utils/supabase/server' -import { NextResponse} from 'next/server' +import { NextResponse } from 'next/server' export const dynamic = 'force-dynamic' @@ -7,9 +7,15 @@ export async function GET(request: Request) { const requestUrl = new URL(request.url) const supabase = createClient() - await supabase.auth.signOut() + const { error } = await supabase.auth.signOut() + + if (error) { + console.log(`logout failed with error`, error) + } return NextResponse.redirect(`${requestUrl.origin}/auth/login`, { - status: 301, + // using temporary redirect, so that browsers don't cache this + // redirection + status: 302, }) } \ No newline at end of file