Open MMore opened 3 years ago
Ok, I've found the problem and would consider that as bug somewhere between pow and _powassent.
I am using the PowAssent.Phoenix.ViewHelpers.provider_links/1
helper to generate links. A link looks like that: http://localhost:4000/auth/google/new?invitation_token=1c23e23b-bf9e-4024-b496-0f9e814c7f63. It's the token I find in the database. Clicking this link leads to the error mentioned above. But when I change the invitation_token
in the link to the signed token I find in the invitation URL which is SFMyNTY.MWMyM2UyM2ItYmY5ZS00MDI0LWI0OTYtMGY5ZTgxNGM3ZjYz.DahUz1bk3HMc9flALHhdNIpSQ1Xv3hXzG9_1Bhaj9Fs
in my case. I can successfully login and a record is created in user_identities
. Nevertheless I see that invitation_accepted_at
isn't set although that's stated in the README of _powassent.
Can you confirm or do I have a wrong configuration? Thank you.
Sounds like you've generated templates for Pow but not for PowAssent? Try run mix pow_assent.phoenix.gen.templates
to generate the templates and view files. It tries to render the screen where you input a different user id if it has already been taken or wasn't provided.
Also I've plans to make it possible to link up the existing users with new provider: https://github.com/pow-auth/pow_assent/issues/115
Hey @danschultzer, indeed the mix task generates two files. I've tried again but the problem persists. I checked the documentations again and it says "Otherwise, Pow will raise an error about missing template when the user id field template is shown" which wasn't the case. Moreover I am wondering why the provider link is wrong. The generation of it seems to be independent on the template. Thank you!
Is it the same error? If that's the case, then I would check where MODULE.PowAssent.RegistrationView
is. MODULE should be the namespace your project uses. I think this might be the issue as well, and that you are using a different web_module
in your config than MyAppWeb
.
Moreover I am wondering why the provider link is wrong. The generation of it seems to be independent on the template.
Can you share more information on this?
Hi,
yes, it's the same error. I don't have customized templates for PowAssent, so I don't have the template files and not files like MODULE.PowAssent.RegistrationView
. I only customized templates and views for Pow, PowEmailConfirmation and PowInvitation. In the pow_invitation/invitation/edit.html.eex
I've added a PowAssent link using PowAssent.Phoenix.ViewHelpers.authorization_link(@conn, :google)
. This link uses the same token I see in the database. Is that correct? Because as I said, when I replace that token to the token I have in the invitation URL it works (at least partly, see 1st and 2nd post above).
Moreover I am wondering why the provider link is wrong. The generation of it seems to be independent on the template. Can you share more information on this?
I mean that the generated templates you mentioned above don't have an impact on the provider link generation itself because they are pure functions.
BTW: I replaced my project module name by MyAppWeb
only here in the post.
Thanks!
Hi,
after I've added PowInvitation and trying to use PowAssent for logging in via Google as an invited user I get the following issue. The provider link included the invitation_token as query param.:
For me it looks like it tries to create the user again and can't because it already exists. But it exists because PowInvitation created it. And it can't find an entry in
user_identities
because the user wasn't created by himself via Login/Registration with Google.Any ideas?