[auth] Add deprecation warnings for non withData methods

This commit is contained in:
Chris Bianca 2018-01-24 12:20:24 +00:00
parent 248885f03e
commit af35cda353
2 changed files with 11 additions and 1 deletions

View File

@ -115,7 +115,7 @@ export default class User {
} }
/** /**
* * @deprecated Deprecated linkWithCredential in favor of linkAndRetrieveDataWithCredential.
* @param credential * @param credential
*/ */
linkWithCredential(credential: AuthCredential): Promise<User> { linkWithCredential(credential: AuthCredential): Promise<User> {

View File

@ -211,9 +211,11 @@ export default class Auth extends ModuleBase {
/** /**
* Sign a user in anonymously * Sign a user in anonymously
* @deprecated Deprecated signInAnonymously in favor of signInAnonymouslyAndRetrieveData.
* @return {Promise} A promise resolved upon completion * @return {Promise} A promise resolved upon completion
*/ */
signInAnonymously(): Promise<User> { signInAnonymously(): Promise<User> {
console.warn('Deprecated firebase.User.prototype.signInAnonymously in favor of firebase.User.prototype.signInAnonymouslyAndRetrieveData.');
return getNativeModule(this) return getNativeModule(this)
.signInAnonymously() .signInAnonymously()
.then(user => this._setUser(user)); .then(user => this._setUser(user));
@ -231,11 +233,13 @@ export default class Auth extends ModuleBase {
/** /**
* Create a user with the email/password functionality * Create a user with the email/password functionality
* @deprecated Deprecated createUserWithEmailAndPassword in favor of createUserAndRetrieveDataWithEmailAndPassword.
* @param {string} email The user's email * @param {string} email The user's email
* @param {string} password The user's password * @param {string} password The user's password
* @return {Promise} A promise indicating the completion * @return {Promise} A promise indicating the completion
*/ */
createUserWithEmailAndPassword(email: string, password: string): Promise<User> { createUserWithEmailAndPassword(email: string, password: string): Promise<User> {
console.warn('Deprecated firebase.User.prototype.createUserWithEmailAndPassword in favor of firebase.User.prototype.createUserAndRetrieveDataWithEmailAndPassword.');
return getNativeModule(this) return getNativeModule(this)
.createUserWithEmailAndPassword(email, password) .createUserWithEmailAndPassword(email, password)
.then(user => this._setUser(user)); .then(user => this._setUser(user));
@ -255,11 +259,13 @@ export default class Auth extends ModuleBase {
/** /**
* Sign a user in with email/password * Sign a user in with email/password
* @deprecated Deprecated signInWithEmailAndPassword in favor of signInAndRetrieveDataWithEmailAndPassword
* @param {string} email The user's email * @param {string} email The user's email
* @param {string} password The user's password * @param {string} password The user's password
* @return {Promise} A promise that is resolved upon completion * @return {Promise} A promise that is resolved upon completion
*/ */
signInWithEmailAndPassword(email: string, password: string): Promise<User> { signInWithEmailAndPassword(email: string, password: string): Promise<User> {
console.warn('Deprecated firebase.User.prototype.signInWithEmailAndPassword in favor of firebase.User.prototype.signInAndRetrieveDataWithEmailAndPassword.');
return getNativeModule(this) return getNativeModule(this)
.signInWithEmailAndPassword(email, password) .signInWithEmailAndPassword(email, password)
.then(user => this._setUser(user)); .then(user => this._setUser(user));
@ -279,10 +285,12 @@ export default class Auth extends ModuleBase {
/** /**
* Sign the user in with a custom auth token * 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. * @param {string} customToken A self-signed custom auth token.
* @return {Promise} A promise resolved upon completion * @return {Promise} A promise resolved upon completion
*/ */
signInWithCustomToken(customToken: string): Promise<User> { signInWithCustomToken(customToken: string): Promise<User> {
console.warn('Deprecated firebase.User.prototype.signInWithCustomToken in favor of firebase.User.prototype.signInAndRetrieveDataWithCustomToken.');
return getNativeModule(this) return getNativeModule(this)
.signInWithCustomToken(customToken) .signInWithCustomToken(customToken)
.then(user => this._setUser(user)); .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 * Sign the user in with a third-party authentication provider
* @deprecated Deprecated signInWithCredential in favor of signInAndRetrieveDataWithCredential.
* @return {Promise} A promise resolved upon completion * @return {Promise} A promise resolved upon completion
*/ */
signInWithCredential(credential: AuthCredential): Promise<User> { signInWithCredential(credential: AuthCredential): Promise<User> {
console.warn('Deprecated firebase.User.prototype.signInWithCredential in favor of firebase.User.prototype.signInAndRetrieveDataWithCredential.');
return getNativeModule(this) return getNativeModule(this)
.signInWithCredential(credential.providerId, credential.token, credential.secret) .signInWithCredential(credential.providerId, credential.token, credential.secret)
.then(user => this._setUser(user)); .then(user => this._setUser(user));