Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion firebase-auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,31 @@
sendPasswordResetEmail: function(email) {
return this._handleSignIn(this.auth.sendPasswordResetEmail(email));
},


/**
* Authenticates a Firebase client using a phone number.
*
* @param {!String} phoneNumber Phone number of the user.
* @return {Promise} Promise that handles success and failure.
*/
signInWithPhoneNumber: function(phoneNumber) {
var appVerifier = new firebase.auth.RecaptchaVerifier(document.getElementById('recaptcha-container'));
return this._handleSignIn(firebase.auth().signInWithPhoneNumber(phoneNumber, appVerifier)
.then(function(confirmationResult) {
window.confirmationResult = confirmationResult;
}));
},

/**
* Confirms authentication code for phone number sign-in.
*
* @param {!String} code One-time code contained in the SMS message.
* @return {Promise} Promise that handles success and failure.
*/
confirmCode: function(code) {
return this._handleSignIn(window.confirmationResult.confirm(code));
},

/**
* Unauthenticates a Firebase client.
*
Expand Down