From c2ce379b2cbf862b0383b089bf939526e3301ab2 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 24 Sep 2017 13:17:20 +0100 Subject: [PATCH] fixed invalid references to native module 'FirebaseAuth' and added phone auth statics --- lib/modules/auth/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index e81e1c6c..0279cc67 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -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.} */ confirmPasswordReset(code: string, newPassword: string): Promise { - return FirebaseAuth.confirmPasswordReset(code, newPassword); + return this._native.confirmPasswordReset(code, newPassword); } /** @@ -229,7 +231,7 @@ export default class Auth extends ModuleBase { * @return {Promise.} */ applyActionCode(code: string): Promise { - return FirebaseAuth.applyActionCode(code); + return this._native.applyActionCode(code); } /** @@ -240,7 +242,7 @@ export default class Auth extends ModuleBase { * @return {Promise.|Promise} */ checkActionCode(code: string): Promise { - 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', + }, };