disableSignUp
status set to true
.When I create the user (in Python) using
auth.create_user(email=email, display_name=name, photo_url=profile_image_url)
a user is created but the user has no providerData
and is shown the message:
newuser@example.com is not authorized to view the requested page.
That's unexpected - the Firebaseui documentation says that users can be created through the API and one would expect such users to be able to log in!
When I create the user as above but with a password, they are allowed to log in but they are shown a password prompt.
How can I create a new email user and force email link sign in?
I already have a cloud function to notify users that their account has been created. I added
var actionCodeSettings = {
url: 'https://example.com/welcome',
handleCodeInApp: true,
};
const link = await admin.auth().generateSignInWithEmailLink(user.email, actionCodeSettings);
to the function, and they now get a link to complete their account setup. Landing on '/welcome' opens the firebaseui-auth-container
where the message "Confirm your email to complete sign in" is shown. The email is confirmed, and the user is changed to an emailLink
user. It's a quite natural flow, almost as if it was designed for that purpose...