Get user inside session hook
Is there a way to get the userinfo inside a before session databaseHook?
I can't call auth.api.getSession and then read the user object as its in the initialization of auth.
My goal is to automatically set the active org based on the email domain.
2 Replies
by the looks of it, i would need to do my own db call inside it right to get the wanted info?
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
My goal is to automatically set the active org based on the email domainI recommend using after hook for
user
update
user: update: after
Then see if email domain changed, then set active org - sort of thing
If you know what I mean 😆