[js][auth] add isSignInWithEmailLink method

This commit is contained in:
Salakar 2018-05-12 23:27:05 +01:00
parent 56ffaac06b
commit b98276c2a5
1 changed files with 12 additions and 0 deletions

View File

@ -406,6 +406,18 @@ export default class Auth extends ModuleBase {
);
}
/**
* Checks if an incoming link is a sign-in with email link.
* @param {string} emailLink Sign-in email link.
*/
isSignInWithEmailLink(emailLink: string): boolean {
return (
typeof emailLink === 'string' &&
emailLink.includes('mode=signIn') &&
emailLink.includes('oobCode=')
);
}
/**
* Completes the password reset process, given a confirmation code and new password.
*