I want to save the last active organization to automatically apply it to a new user session. I got the second part, but I'm unsure on how to save it in my database.
I've tried the following,
hooks: { after: createAuthMiddleware(async (ctx) => { // ctx.context.session is null if (ctx.path === '/organization/set-active') { const organizationId = ctx.context?.returned?.id; if (organizationId) { // TODO update database } } }) }
hooks: { after: createAuthMiddleware(async (ctx) => { // ctx.context.session is null if (ctx.path === '/organization/set-active') { const organizationId = ctx.context?.returned?.id; if (organizationId) { // TODO update database } } }) }
Is this suited for github? Yes, this is suited for github To Reproduce Use the auth config from below. Call setActive from the organization plugin Current vs. Expected behavior I expect to somewher...