Firebase Web SDK createUserWithEmailAndPassword not logging in users after creation
up vote
0
down vote
favorite
I'm using Firebase email/password authentication.
This provider is activated for this project in Firebase console.
I'm using the Web SDK, and it is properly configured.
I have a form to signup that prompts the user to enter an email and a password to signup and authenticate.
firebase.auth().createUserWithEmailAndPassword(this.email, this.password)
is called when the user is signing up. The user is then directed the next step to fill his/her profile.
At this point
fb.auth.onAuthStateChanged(fbUser => {
if (fbUser) {
console.log('Logged in. User is: ', fbUser)
} else {
console.error('not logged in')
}
})
returns 'not logged in' while the user should be logged in according to the Firebase documentation (https://firebase.google.com/docs/auth/web/password-auth)
firebase firebase-authentication
|
show 2 more comments
up vote
0
down vote
favorite
I'm using Firebase email/password authentication.
This provider is activated for this project in Firebase console.
I'm using the Web SDK, and it is properly configured.
I have a form to signup that prompts the user to enter an email and a password to signup and authenticate.
firebase.auth().createUserWithEmailAndPassword(this.email, this.password)
is called when the user is signing up. The user is then directed the next step to fill his/her profile.
At this point
fb.auth.onAuthStateChanged(fbUser => {
if (fbUser) {
console.log('Logged in. User is: ', fbUser)
} else {
console.error('not logged in')
}
})
returns 'not logged in' while the user should be logged in according to the Firebase documentation (https://firebase.google.com/docs/auth/web/password-auth)
firebase firebase-authentication
Firebase version 5.5.8
– Stephane Paquet
Nov 12 at 3:35
Hmm... that sounds weird. Can you reproduce it in a site like jsbin or stackblitz, so I can have a look?
– Frank van Puffelen
Nov 12 at 4:17
The only way I can see this happening is if the "next step" is a separate page (so a reload). In that caseonAuthState
should fire twice: first with no user, and then later (once the user token is validated) with the actual user.
– Frank van Puffelen
Nov 12 at 4:18
It's not a reload. I'm using a stepper. So everything is happening on the same page.
– Stephane Paquet
Nov 12 at 5:56
Agree that this is weird as there is a call tosendEmailVerification()
in the callback section ofcreateUserWithEmailAndPassword
which is working as newly created users are receiving the email to confirm their email address.
– Stephane Paquet
Nov 12 at 5:58
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm using Firebase email/password authentication.
This provider is activated for this project in Firebase console.
I'm using the Web SDK, and it is properly configured.
I have a form to signup that prompts the user to enter an email and a password to signup and authenticate.
firebase.auth().createUserWithEmailAndPassword(this.email, this.password)
is called when the user is signing up. The user is then directed the next step to fill his/her profile.
At this point
fb.auth.onAuthStateChanged(fbUser => {
if (fbUser) {
console.log('Logged in. User is: ', fbUser)
} else {
console.error('not logged in')
}
})
returns 'not logged in' while the user should be logged in according to the Firebase documentation (https://firebase.google.com/docs/auth/web/password-auth)
firebase firebase-authentication
I'm using Firebase email/password authentication.
This provider is activated for this project in Firebase console.
I'm using the Web SDK, and it is properly configured.
I have a form to signup that prompts the user to enter an email and a password to signup and authenticate.
firebase.auth().createUserWithEmailAndPassword(this.email, this.password)
is called when the user is signing up. The user is then directed the next step to fill his/her profile.
At this point
fb.auth.onAuthStateChanged(fbUser => {
if (fbUser) {
console.log('Logged in. User is: ', fbUser)
} else {
console.error('not logged in')
}
})
returns 'not logged in' while the user should be logged in according to the Firebase documentation (https://firebase.google.com/docs/auth/web/password-auth)
firebase firebase-authentication
firebase firebase-authentication
asked Nov 12 at 3:33
Stephane Paquet
1,6541423
1,6541423
Firebase version 5.5.8
– Stephane Paquet
Nov 12 at 3:35
Hmm... that sounds weird. Can you reproduce it in a site like jsbin or stackblitz, so I can have a look?
– Frank van Puffelen
Nov 12 at 4:17
The only way I can see this happening is if the "next step" is a separate page (so a reload). In that caseonAuthState
should fire twice: first with no user, and then later (once the user token is validated) with the actual user.
– Frank van Puffelen
Nov 12 at 4:18
It's not a reload. I'm using a stepper. So everything is happening on the same page.
– Stephane Paquet
Nov 12 at 5:56
Agree that this is weird as there is a call tosendEmailVerification()
in the callback section ofcreateUserWithEmailAndPassword
which is working as newly created users are receiving the email to confirm their email address.
– Stephane Paquet
Nov 12 at 5:58
|
show 2 more comments
Firebase version 5.5.8
– Stephane Paquet
Nov 12 at 3:35
Hmm... that sounds weird. Can you reproduce it in a site like jsbin or stackblitz, so I can have a look?
– Frank van Puffelen
Nov 12 at 4:17
The only way I can see this happening is if the "next step" is a separate page (so a reload). In that caseonAuthState
should fire twice: first with no user, and then later (once the user token is validated) with the actual user.
– Frank van Puffelen
Nov 12 at 4:18
It's not a reload. I'm using a stepper. So everything is happening on the same page.
– Stephane Paquet
Nov 12 at 5:56
Agree that this is weird as there is a call tosendEmailVerification()
in the callback section ofcreateUserWithEmailAndPassword
which is working as newly created users are receiving the email to confirm their email address.
– Stephane Paquet
Nov 12 at 5:58
Firebase version 5.5.8
– Stephane Paquet
Nov 12 at 3:35
Firebase version 5.5.8
– Stephane Paquet
Nov 12 at 3:35
Hmm... that sounds weird. Can you reproduce it in a site like jsbin or stackblitz, so I can have a look?
– Frank van Puffelen
Nov 12 at 4:17
Hmm... that sounds weird. Can you reproduce it in a site like jsbin or stackblitz, so I can have a look?
– Frank van Puffelen
Nov 12 at 4:17
The only way I can see this happening is if the "next step" is a separate page (so a reload). In that case
onAuthState
should fire twice: first with no user, and then later (once the user token is validated) with the actual user.– Frank van Puffelen
Nov 12 at 4:18
The only way I can see this happening is if the "next step" is a separate page (so a reload). In that case
onAuthState
should fire twice: first with no user, and then later (once the user token is validated) with the actual user.– Frank van Puffelen
Nov 12 at 4:18
It's not a reload. I'm using a stepper. So everything is happening on the same page.
– Stephane Paquet
Nov 12 at 5:56
It's not a reload. I'm using a stepper. So everything is happening on the same page.
– Stephane Paquet
Nov 12 at 5:56
Agree that this is weird as there is a call to
sendEmailVerification()
in the callback section of createUserWithEmailAndPassword
which is working as newly created users are receiving the email to confirm their email address.– Stephane Paquet
Nov 12 at 5:58
Agree that this is weird as there is a call to
sendEmailVerification()
in the callback section of createUserWithEmailAndPassword
which is working as newly created users are receiving the email to confirm their email address.– Stephane Paquet
Nov 12 at 5:58
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53255626%2ffirebase-web-sdk-createuserwithemailandpassword-not-logging-in-users-after-creat%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Firebase version 5.5.8
– Stephane Paquet
Nov 12 at 3:35
Hmm... that sounds weird. Can you reproduce it in a site like jsbin or stackblitz, so I can have a look?
– Frank van Puffelen
Nov 12 at 4:17
The only way I can see this happening is if the "next step" is a separate page (so a reload). In that case
onAuthState
should fire twice: first with no user, and then later (once the user token is validated) with the actual user.– Frank van Puffelen
Nov 12 at 4:18
It's not a reload. I'm using a stepper. So everything is happening on the same page.
– Stephane Paquet
Nov 12 at 5:56
Agree that this is weird as there is a call to
sendEmailVerification()
in the callback section ofcreateUserWithEmailAndPassword
which is working as newly created users are receiving the email to confirm their email address.– Stephane Paquet
Nov 12 at 5:58