Answer the question
In order to leave comments, you need to log in
How to check Firebase auth on backend?
I do authorization by phone number as described in the Firebase tutorial, but apparently I don’t catch up with something
1. I send the number
firebase.auth().signInWithPhoneNumber(phoneNumber, appVerifier)
.then(function (confirmationResult) {
window.confirmationResult = confirmationResult;
//Отправили смс
}).catch(function (error) {
console.log('error',error);
// Error; SMS not sent
// ...
});
confirmationResult.confirm(code_from_sms).then(function (result) {
// User signed in successfully.
var user = result.user;
console.log('code confirm',user,result);
firebase.auth().currentUser.getIdToken(false).then(function (idToken) {
//Тут получили idToken, и что дальше????
}).catch(function (error) {
console.log('currentUser error',error);
});
}).catch(function (error) {
// User couldn't sign in (bad verification code?)
console.log('code error confirm',error);
// ...
});
Answer the question
In order to leave comments, you need to log in
After authorization, you have a token from Google. On the backend, you can check it through the library: https://firebase-php.readthedocs.io/en/stable/auth...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question