Issue to reauthenticate user

661 views
Skip to first unread message

Arsenio Aguirre

unread,
Jan 5, 2019, 10:49:31 AM1/5/19
to Firebase Google Group
Hi, can you support me about the following code of firebase? credential is refer to? I don't know if credential variable is a json with email and password or just the password.

var user = firebase.auth().currentUser;
var credential;

// Prompt the user to re-provide their sign-in credentials

user
.reauthenticateAndRetrieveDataWithCredential(credential).then(function() {
 
// User re-authenticated.
}).catch(function(error) {
 
// An error happened.
});

I am having the next error:

code: "auth/argument-error"
message: "reauthenticateAndRetrieveDataWithCredential failed: First argument \"credential\" must be a valid credential."

stack: ""

Bassam

unread,
Jan 7, 2019, 1:01:31 AM1/7/19
to Firebase Google Group
Hey there, the credential is a Firebase AuthCredential. For an email/password, it is initialized as follows:
var credential = firebase.auth.EmailAuthProvider.credential(email, password);

Best regards,
Bassam

Arsenio Aguirre

unread,
Jan 7, 2019, 11:35:08 PM1/7/19
to fireba...@googlegroups.com
Hi Bassam, thanks for your response. I had tried and it shows the next issue:

TypeError: Cannot read property 'credential' of undefined

Can you help me?

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/7e6261c6-3366-4365-949d-14f9bad06e0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arsenio Aguirre

unread,
Jan 10, 2019, 10:15:22 AM1/10/19
to fireba...@googlegroups.com
Hi Bassam, did you see the error?

Thanks in advance.

Regards,
Arsenio
Reply all
Reply to author
Forward
0 new messages