-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow for connecting provider with existing user when not signed in #115
Comments
This makes a lot of sense. I’ll see if it’s possible with Pow. It ties in with the custom with flow planned with pow-auth/pow#6 |
Related: #18 |
Hi, @danhunsaker. I have a combination of all user issues. I am using Pow and PowAssent for API-bases authentication with my frontend client.
Do you need any help with issues to resolve this blocker? |
Hi @sveredyuk sorry I missed this comment. So this issue would only resolve how the flow works on web rather than API, though it may make it easier to work with the plug methods. To make this work I'll have to figure out the users current available auth methods. In your case, if the user has previously used Google and there's now a conflict on user id (email) trying to auth with Github, it should probably present the above dialog with an "Sign in with Google" method. I also think in many cases it makes sense to bypass this if the email from the provider has been verified, though I don't want this to be enabled by default (email isn't a secure channel). I would like to update the docs on how you can sign in the user automatically if the verified email exists in the system already. This would apply to custom controllers as well (so can work in API). Currently when there's a constraint error on the user id field, it's treated the same way as if the user id was invalid or missing, and you have to enter a new one. So you can listen for the Alternatively you can bypass all this by having a custom user identities context with a |
@danschultzer Is there any plan for how to solve this challenge? Maybe there is some example for that? Thanks for this library 👍 👍 EDIT: I'm playing with custom user identities context. I've added def create_user(user_identity_params, user_params, user_id_params) do
case VelomapEx.Users.get_by(%{email: email}) do
nil ->
pow_assent_create_user(user_identity_params, user_params, user_id_params)
user ->
case pow_assent_upsert(user, user_identity_params) do
{:ok, _} -> {:ok, user}
err -> err
end
end
end |
Originally posted by @coladarci in #113 (comment)
The text was updated successfully, but these errors were encountered: