umang
umang
BABetter Auth
Created by Bruh on 5/8/2025 in #help
Database Hooks `before.create` Has Undefined Context
chiming in here, as I have a similar issue: i'm trying to access the context object and use internalAdapter.deleteSessions to manually revoke other session. But context is always coming back as null. code for reference:
databaseHooks: {
session: {
create: {
after: async( session, context ) => {
const allSessions = await context?.context.internalAdapter.listSessions(session.userId);
const sessionIdsToDelete = allSessions ? allSessions.map(s => s.id).filter(id => id !== session.id) : undefined;
if( sessionIdsToDelete ) {
await context
context?.context.internalAdapter.deleteSessions(sessionIdsToDelete);
}
}
}
}
},
databaseHooks: {
session: {
create: {
after: async( session, context ) => {
const allSessions = await context?.context.internalAdapter.listSessions(session.userId);
const sessionIdsToDelete = allSessions ? allSessions.map(s => s.id).filter(id => id !== session.id) : undefined;
if( sessionIdsToDelete ) {
await context
context?.context.internalAdapter.deleteSessions(sessionIdsToDelete);
}
}
}
}
},
6 replies
BABetter Auth
Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
i'm using client side library for file uploads to supabase storage, so setting RLS policies mainly for peace of mind. DB queries go through my server. I could use their service_role token but i don't like using keys that have total admin privileges. they don't allow anything in between (that i could find)
63 replies
BABetter Auth
Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
@insightautomate thank you, this is really helpful!
63 replies
BABetter Auth
Created by oof2win2 on 2/10/2025 in #help
integrating with postgres rls (supabase)
hi @insightautomate - could you share how you went about implementing RLS? i'm failing completely at trying to make this work.
i'm migrating over from supabase auth, and i'm considering rolling back :/
63 replies