From af35cda3536e9417004d554bb11bab6e81d82e55 Mon Sep 17 00:00:00 2001 From: Chris Bianca Date: Wed, 24 Jan 2018 12:20:24 +0000 Subject: [PATCH] [auth] Add deprecation warnings for non withData methods --- lib/modules/auth/User.js | 2 +- lib/modules/auth/index.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/modules/auth/User.js b/lib/modules/auth/User.js index 6e685b35..e4f7a2b0 100644 --- a/lib/modules/auth/User.js +++ b/lib/modules/auth/User.js @@ -115,7 +115,7 @@ export default class User { } /** - * + * @deprecated Deprecated linkWithCredential in favor of linkAndRetrieveDataWithCredential. * @param credential */ linkWithCredential(credential: AuthCredential): Promise { diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index 770e47f5..427b9c72 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -211,9 +211,11 @@ export default class Auth extends ModuleBase { /** * Sign a user in anonymously + * @deprecated Deprecated signInAnonymously in favor of signInAnonymouslyAndRetrieveData. * @return {Promise} A promise resolved upon completion */ signInAnonymously(): Promise { + console.warn('Deprecated firebase.User.prototype.signInAnonymously in favor of firebase.User.prototype.signInAnonymouslyAndRetrieveData.'); return getNativeModule(this) .signInAnonymously() .then(user => this._setUser(user)); @@ -231,11 +233,13 @@ export default class Auth extends ModuleBase { /** * Create a user with the email/password functionality + * @deprecated Deprecated createUserWithEmailAndPassword in favor of createUserAndRetrieveDataWithEmailAndPassword. * @param {string} email The user's email * @param {string} password The user's password * @return {Promise} A promise indicating the completion */ createUserWithEmailAndPassword(email: string, password: string): Promise { + console.warn('Deprecated firebase.User.prototype.createUserWithEmailAndPassword in favor of firebase.User.prototype.createUserAndRetrieveDataWithEmailAndPassword.'); return getNativeModule(this) .createUserWithEmailAndPassword(email, password) .then(user => this._setUser(user)); @@ -255,11 +259,13 @@ export default class Auth extends ModuleBase { /** * Sign a user in with email/password + * @deprecated Deprecated signInWithEmailAndPassword in favor of signInAndRetrieveDataWithEmailAndPassword * @param {string} email The user's email * @param {string} password The user's password * @return {Promise} A promise that is resolved upon completion */ signInWithEmailAndPassword(email: string, password: string): Promise { + console.warn('Deprecated firebase.User.prototype.signInWithEmailAndPassword in favor of firebase.User.prototype.signInAndRetrieveDataWithEmailAndPassword.'); return getNativeModule(this) .signInWithEmailAndPassword(email, password) .then(user => this._setUser(user)); @@ -279,10 +285,12 @@ export default class Auth extends ModuleBase { /** * Sign the user in with a custom auth token + * @deprecated Deprecated signInWithCustomToken in favor of signInAndRetrieveDataWithCustomToken * @param {string} customToken A self-signed custom auth token. * @return {Promise} A promise resolved upon completion */ signInWithCustomToken(customToken: string): Promise { + console.warn('Deprecated firebase.User.prototype.signInWithCustomToken in favor of firebase.User.prototype.signInAndRetrieveDataWithCustomToken.'); return getNativeModule(this) .signInWithCustomToken(customToken) .then(user => this._setUser(user)); @@ -301,9 +309,11 @@ export default class Auth extends ModuleBase { /** * Sign the user in with a third-party authentication provider + * @deprecated Deprecated signInWithCredential in favor of signInAndRetrieveDataWithCredential. * @return {Promise} A promise resolved upon completion */ signInWithCredential(credential: AuthCredential): Promise { + console.warn('Deprecated firebase.User.prototype.signInWithCredential in favor of firebase.User.prototype.signInAndRetrieveDataWithCredential.'); return getNativeModule(this) .signInWithCredential(credential.providerId, credential.token, credential.secret) .then(user => this._setUser(user));