[auth] add verifyPhoneNumber
This commit is contained in:
parent
43e17f4b16
commit
fd788b9d5d
@ -6,11 +6,13 @@ import ConfirmationResult from './ConfirmationResult';
|
||||
|
||||
// providers
|
||||
import EmailAuthProvider from './providers/EmailAuthProvider';
|
||||
import PhoneAuthProvider from './providers/PhoneAuthProvider';
|
||||
import GoogleAuthProvider from './providers/GoogleAuthProvider';
|
||||
import GithubAuthProvider from './providers/GithubAuthProvider';
|
||||
import TwitterAuthProvider from './providers/TwitterAuthProvider';
|
||||
import FacebookAuthProvider from './providers/FacebookAuthProvider';
|
||||
import PhoneAuthProvider from './providers/PhoneAuthProvider';
|
||||
|
||||
import PhoneAuthListener from './PhoneAuthListener';
|
||||
|
||||
export default class Auth extends ModuleBase {
|
||||
static _NAMESPACE = 'auth';
|
||||
@ -203,6 +205,19 @@ export default class Auth extends ModuleBase {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a PhoneAuthListener to listen to phone verification events,
|
||||
* on the final completion event a PhoneAuthCredential can be generated for
|
||||
* authentication purposes.
|
||||
*
|
||||
* @param phoneNumber
|
||||
* @param autoVerifyTimeout Android Only
|
||||
* @returns {PhoneAuthListener}
|
||||
*/
|
||||
verifyPhoneNumber(phoneNumber: string, autoVerifyTimeout?: number): PhoneAuthListener {
|
||||
return new PhoneAuthListener(this, phoneNumber, autoVerifyTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send reset password instructions via email
|
||||
* @param {string} email The email to send password reset instructions
|
||||
@ -305,10 +320,10 @@ export const statics = {
|
||||
GithubAuthProvider,
|
||||
TwitterAuthProvider,
|
||||
FacebookAuthProvider,
|
||||
VerifyPhoneState: {
|
||||
PhoneAuthState: {
|
||||
CODE_SENT: 'sent',
|
||||
AUTO_VERIFY_TIMEOUT: 'timeout',
|
||||
SUCCESS: 'success',
|
||||
AUTO_VERIFIED: 'verified',
|
||||
ERROR: 'error',
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user