diff --git a/server/middleware/auth.ts b/server/middleware/auth.ts index 7aa3bfd..49c5c22 100644 --- a/server/middleware/auth.ts +++ b/server/middleware/auth.ts @@ -1,7 +1,5 @@ import { serverSupabaseUser } from '#supabase/server'; export default defineEventHandler(async (event) => { - const user = await serverSupabaseUser(event); - - event.context.auth = { user }; + await serverSupabaseUser(event); }); diff --git a/server/services/supabaseService.ts b/server/services/supabaseService.ts index 81a4097..3308ef8 100644 --- a/server/services/supabaseService.ts +++ b/server/services/supabaseService.ts @@ -9,6 +9,6 @@ export default class SupabaseService { constructor(event: H3Event) { this.client = serverSupabaseServiceRole(event); - this.user = event.context.auth.user; + this.user = event.context._user; } }