[js][auth] add signInWithEmailLink method + tweak isSignInWithEmailLink
This commit is contained in:
parent
3cba1c4e62
commit
59b406e8ed
@ -413,11 +413,28 @@ export default class Auth extends ModuleBase {
|
||||
isSignInWithEmailLink(emailLink: string): boolean {
|
||||
return (
|
||||
typeof emailLink === 'string' &&
|
||||
emailLink.includes('mode=signIn') &&
|
||||
emailLink.includes('oobCode=')
|
||||
(emailLink.includes('mode=signIn') ||
|
||||
emailLink.includes('mode%3DsignIn')) &&
|
||||
(emailLink.includes('oobCode=') || emailLink.includes('oobCode%3D'))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronously signs in using an email and sign-in email link.
|
||||
*
|
||||
* @param {string} email The email account to sign in with.
|
||||
* @param {string} emailLink Sign-in email link.
|
||||
* @return {Promise} A promise resolved upon completion
|
||||
*/
|
||||
signInWithEmailLink(
|
||||
email: string,
|
||||
emailLink: string
|
||||
): Promise<UserCredential> {
|
||||
return getNativeModule(this)
|
||||
.signInWithEmailLink(email, emailLink)
|
||||
.then(userCredential => this._setUserCredential(userCredential));
|
||||
}
|
||||
|
||||
/**
|
||||
* Completes the password reset process, given a confirmation code and new password.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user