[auth] Add deprecation warnings for non withData methods
This commit is contained in:
parent
248885f03e
commit
af35cda353
|
@ -115,7 +115,7 @@ export default class User {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated Deprecated linkWithCredential in favor of linkAndRetrieveDataWithCredential.
|
||||
* @param credential
|
||||
*/
|
||||
linkWithCredential(credential: AuthCredential): Promise<User> {
|
||||
|
|
|
@ -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<User> {
|
||||
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<User> {
|
||||
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<User> {
|
||||
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<User> {
|
||||
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<User> {
|
||||
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));
|
||||
|
|
Loading…
Reference in New Issue