It happens when there’s an error on the user id field, both if it has been taken already or if it’s not the right format (though with Github and standard Pow setup that would not happen). Here’s the logic: pow_assent/lib/pow_assent/phoenix/controllers/authorization_controller.ex at v0.4.5 · pow-auth/pow_assent · GitHub
The context is what sends back the {:error, {:invalid_user_id_field, changeset}} error, as seen here: pow_assent/lib/pow_assent/ecto/user_identities/context.ex at v0.4.5 · pow-auth/pow_assent · GitHub
So if you don’t really worry about security implications, you could add a custom create_user/3 context method, where after pow_assent_create_user/3 returns the above error, you can just look up the user for the email and then call pow_assent_upsert/2.
If you want to instead let users log in first, then you have to set up custom controllers. But as I wrote before, I’ll look into that when I got time.


















