srd
srd
BABetter Auth
Created by srd on 4/20/2025 in #help
See what provider made the session
i basically need it to automatically set the active org, but only when you log on using microsoft
7 replies
BABetter Auth
Created by srd on 4/20/2025 in #help
See what provider made the session
is the only option to temp save the info in a map for example to be able to get it in the db hook before session?
7 replies
BABetter Auth
Created by srd on 4/20/2025 in #help
See what provider made the session
No description
7 replies
BABetter Auth
Created by srd on 4/19/2025 in #help
Get user inside session hook
I think this is the best, and then add the user as a member to the org upon account creation. User will only be connected to one org anyways
databaseHooks: {
session: {
create: {
before: async (session) => {
const [rows] = await db.execute(
'SELECT organizationId FROM member WHERE userId = ? LIMIT 1',
[session.userId]
);
const org = rows[0]?.organizationId ?? null;
return {
data: {
...session,
activeOrganizationId: org
}
}
}
}
}
}
databaseHooks: {
session: {
create: {
before: async (session) => {
const [rows] = await db.execute(
'SELECT organizationId FROM member WHERE userId = ? LIMIT 1',
[session.userId]
);
const org = rows[0]?.organizationId ?? null;
return {
data: {
...session,
activeOrganizationId: org
}
}
}
}
}
}
6 replies
BABetter Auth
Created by srd on 4/19/2025 in #help
Get user inside session hook
by the looks of it, i would need to do my own db call inside it right to get the wanted info?
6 replies
BABetter Auth
Created by SxYxuse on 4/9/2025 in #help
onAPIError not working
Hey, do you have an idea on when this will be looked at?
15 replies
BABetter Auth
Created by srd on 4/18/2025 in #help
Multiple accounts with the same e-mail
would it be possible with a type of that modified the email so you could get a new unique one? "provider+email"
6 replies