Is there an easy way to do the same as the example above, but when using Google as a social sign in? I use Google Workspace at my work and we have custom domains, so I want to be able to verify if we're logging in with a Google account from that workspace. I'd like to be able to change where I'm sending the user depending on their email.
I've tried many things, like throwing
APIError
APIError
inside of
mapProfileToUser
mapProfileToUser
or
getUserInfo
getUserInfo
, but it doesn't trigger a redirection to
/api/auth/error
/api/auth/error
, which I could have short-circuited to maybe do what I want, but it didn't work out.
As far as I can see there's no easy way to intercept/read data as you're trying to log in through a social provider, only when creating an account, through database hooks, but I would like to intercept any sign-in whatsoever.