Closed benonymus closed 2 years ago
This is because PowAssent looks up the user in a different table (using PowAssent.Operations.get_user_by_provider_uid/3
) when loading the user:
PowAssent has :user_identities_context
config which works the same way as the :users_context
for Pow:
This way you can add get_user_by_provider_uid/3
to your context module and make add the preloads.
An alternative could also be to use a custom repo module for all of Pow, though that'll be less explicit.
Thank you!
Hey,
I am having a problem with the current_user in conn in Pow.Phoenix.Routes.after_sign_in_path/1 .
In the current setup we use a custom function to load the user(with preloads) with the Pow.Ecto.Context.
This works great in general.
We are using Pow.Phoenix.Routes.after_sign_in_path/1 and here the user from Pow.Plug.current_user(conn) when it is a regular email + pwd the user is preloaded correctly.
But when it is an oauth(google) login the user does not have the preloads.
It seems like based on logging that when it is an oauth login(maybe same for registration) the function is not used, whilst when email+ pwd it is.
Afterwards the user is loaded in fully, but for get_redirect_path/1 we need the user with the preloads.
Any idea as to why this inconsistency happens?
Thank you