fixed invalid references to native module 'FirebaseAuth' and added phone auth statics

This commit is contained in:
Salakar 2017-09-24 13:17:20 +01:00
parent 75dfae369a
commit c2ce379b2c
1 changed files with 11 additions and 3 deletions

View File

@ -25,12 +25,14 @@ export default class Auth extends ModuleBase {
this._user = null;
this._authResult = null;
this.authenticated = false;
this.addListener(
// sub to internal native event - this fans out to
// public event name: onAuthStateChanged
this._getAppEventName('auth_state_changed'),
this._onAuthStateChanged.bind(this),
);
this.addListener(
// sub to internal native event - this fans out to
// public event name: onIdTokenChanged
@ -218,7 +220,7 @@ export default class Auth extends ModuleBase {
* @return {Promise.<Null>}
*/
confirmPasswordReset(code: string, newPassword: string): Promise<Null> {
return FirebaseAuth.confirmPasswordReset(code, newPassword);
return this._native.confirmPasswordReset(code, newPassword);
}
/**
@ -229,7 +231,7 @@ export default class Auth extends ModuleBase {
* @return {Promise.<Null>}
*/
applyActionCode(code: string): Promise<Any> {
return FirebaseAuth.applyActionCode(code);
return this._native.applyActionCode(code);
}
/**
@ -240,7 +242,7 @@ export default class Auth extends ModuleBase {
* @return {Promise.<Any>|Promise<ActionCodeInfo>}
*/
checkActionCode(code: string): Promise<Any> {
return FirebaseAuth.checkActionCode(code);
return this._native.checkActionCode(code);
}
/**
@ -303,4 +305,10 @@ export const statics = {
GithubAuthProvider,
TwitterAuthProvider,
FacebookAuthProvider,
VerifyPhoneState: {
CODE_SENT: 'sent',
AUTO_VERIFY_TIMEOUT: 'timeout',
SUCCESS: 'success',
ERROR: 'error',
},
};