Skip to content

Commit

Permalink
Remove redundancy in auth
Browse files Browse the repository at this point in the history
  • Loading branch information
netervati committed Jun 17, 2024
1 parent 7f0ebb2 commit bfc1211
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions server/middleware/auth.ts
Original file line number Diff line number Diff line change
@@ -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);
});
2 changes: 1 addition & 1 deletion server/services/supabaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default class SupabaseService {

constructor(event: H3Event) {
this.client = serverSupabaseServiceRole<Database>(event);
this.user = event.context.auth.user;
this.user = event.context._user;
}
}

0 comments on commit bfc1211

Please sign in to comment.