@react-native-firebase/auth 24.1.1 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java +16 -4
- package/dist/module/ActionCodeURL.js +140 -0
- package/dist/module/ActionCodeURL.js.map +1 -0
- package/{lib → dist/module}/ConfirmationResult.js +4 -5
- package/dist/module/ConfirmationResult.js.map +1 -0
- package/{lib → dist/module}/MultiFactorResolver.js +14 -5
- package/dist/module/MultiFactorResolver.js.map +1 -0
- package/{lib → dist/module}/PhoneAuthListener.js +52 -75
- package/dist/module/PhoneAuthListener.js.map +1 -0
- package/dist/module/PhoneAuthState.js +25 -0
- package/dist/module/PhoneAuthState.js.map +1 -0
- package/dist/module/PhoneMultiFactorGenerator.js +39 -0
- package/dist/module/PhoneMultiFactorGenerator.js.map +1 -0
- package/{lib → dist/module}/Settings.js +3 -7
- package/dist/module/Settings.js.map +1 -0
- package/{lib → dist/module}/TotpMultiFactorGenerator.js +20 -15
- package/dist/module/TotpMultiFactorGenerator.js.map +1 -0
- package/{lib → dist/module}/TotpSecret.js +7 -5
- package/dist/module/TotpSecret.js.map +1 -0
- package/dist/module/User.js +245 -0
- package/dist/module/User.js.map +1 -0
- package/dist/module/constants.js +54 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/credentials/AuthCredential.js +51 -0
- package/dist/module/credentials/AuthCredential.js.map +1 -0
- package/dist/module/credentials/EmailAuthCredential.js +51 -0
- package/dist/module/credentials/EmailAuthCredential.js.map +1 -0
- package/dist/module/credentials/OAuthCredential.js +84 -0
- package/dist/module/credentials/OAuthCredential.js.map +1 -0
- package/dist/module/credentials/PhoneAuthCredential.js +50 -0
- package/dist/module/credentials/PhoneAuthCredential.js.map +1 -0
- package/{lib/providers/GoogleAuthProvider.js → dist/module/credentials/index.js} +7 -19
- package/dist/module/credentials/index.js.map +1 -0
- package/{lib → dist/module}/getMultiFactorResolver.js +5 -8
- package/dist/module/getMultiFactorResolver.js.map +1 -0
- package/{lib/providers/FacebookAuthProvider.js → dist/module/index.js} +11 -18
- package/dist/module/index.js.map +1 -0
- package/dist/module/modular.js +779 -0
- package/dist/module/modular.js.map +1 -0
- package/{lib → dist/module}/multiFactor.js +16 -14
- package/dist/module/multiFactor.js.map +1 -0
- package/dist/module/namespaced.js +522 -0
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/password-policy/PasswordPolicyImpl.js +103 -0
- package/dist/module/password-policy/PasswordPolicyImpl.js.map +1 -0
- package/{lib → dist/module}/password-policy/PasswordPolicyMixin.js +14 -16
- package/dist/module/password-policy/PasswordPolicyMixin.js.map +1 -0
- package/{lib → dist/module}/password-policy/passwordPolicyApi.js +18 -12
- package/dist/module/password-policy/passwordPolicyApi.js.map +1 -0
- package/{lib → dist/module}/providers/AppleAuthProvider.js +14 -7
- package/dist/module/providers/AppleAuthProvider.js.map +1 -0
- package/{lib → dist/module}/providers/EmailAuthProvider.js +10 -25
- package/dist/module/providers/EmailAuthProvider.js.map +1 -0
- package/dist/module/providers/FacebookAuthProvider.js +56 -0
- package/dist/module/providers/FacebookAuthProvider.js.map +1 -0
- package/dist/module/providers/GithubAuthProvider.js +49 -0
- package/dist/module/providers/GithubAuthProvider.js.map +1 -0
- package/dist/module/providers/GoogleAuthProvider.js +57 -0
- package/dist/module/providers/GoogleAuthProvider.js.map +1 -0
- package/dist/module/providers/OAuthProvider.js +116 -0
- package/dist/module/providers/OAuthProvider.js.map +1 -0
- package/{lib → dist/module}/providers/OIDCAuthProvider.js +15 -7
- package/dist/module/providers/OIDCAuthProvider.js.map +1 -0
- package/dist/module/providers/PhoneAuthProvider.js +87 -0
- package/dist/module/providers/PhoneAuthProvider.js.map +1 -0
- package/dist/module/providers/TwitterAuthProvider.js +50 -0
- package/dist/module/providers/TwitterAuthProvider.js.map +1 -0
- package/dist/module/types/auth.js +43 -0
- package/dist/module/types/auth.js.map +1 -0
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/types/namespaced.js +62 -0
- package/dist/module/types/namespaced.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/module/web/RNFBAuthModule.android.js +5 -0
- package/dist/module/web/RNFBAuthModule.android.js.map +1 -0
- package/dist/module/web/RNFBAuthModule.ios.js +5 -0
- package/dist/module/web/RNFBAuthModule.ios.js.map +1 -0
- package/{lib → dist/module}/web/RNFBAuthModule.js +104 -321
- package/dist/module/web/RNFBAuthModule.js.map +1 -0
- package/dist/typescript/lib/ActionCodeURL.d.ts +41 -0
- package/dist/typescript/lib/ActionCodeURL.d.ts.map +1 -0
- package/dist/typescript/lib/ConfirmationResult.d.ts +10 -0
- package/dist/typescript/lib/ConfirmationResult.d.ts.map +1 -0
- package/dist/typescript/lib/MultiFactorResolver.d.ts +24 -0
- package/dist/typescript/lib/MultiFactorResolver.d.ts.map +1 -0
- package/dist/typescript/lib/PhoneAuthListener.d.ts +34 -0
- package/dist/typescript/lib/PhoneAuthListener.d.ts.map +1 -0
- package/dist/typescript/lib/PhoneAuthState.d.ts +7 -0
- package/dist/typescript/lib/PhoneAuthState.d.ts.map +1 -0
- package/dist/typescript/lib/PhoneMultiFactorGenerator.d.ts +7 -0
- package/dist/typescript/lib/PhoneMultiFactorGenerator.d.ts.map +1 -0
- package/dist/typescript/lib/Settings.d.ts +13 -0
- package/dist/typescript/lib/Settings.d.ts.map +1 -0
- package/dist/typescript/lib/TotpMultiFactorGenerator.d.ts +11 -0
- package/dist/typescript/lib/TotpMultiFactorGenerator.d.ts.map +1 -0
- package/dist/typescript/lib/TotpSecret.d.ts +33 -0
- package/dist/typescript/lib/TotpSecret.d.ts.map +1 -0
- package/dist/typescript/lib/User.d.ts +51 -0
- package/dist/typescript/lib/User.d.ts.map +1 -0
- package/dist/typescript/lib/constants.d.ts +35 -0
- package/dist/typescript/lib/constants.d.ts.map +1 -0
- package/dist/typescript/lib/credentials/AuthCredential.d.ts +12 -0
- package/dist/typescript/lib/credentials/AuthCredential.d.ts.map +1 -0
- package/dist/typescript/lib/credentials/EmailAuthCredential.d.ts +8 -0
- package/dist/typescript/lib/credentials/EmailAuthCredential.d.ts.map +1 -0
- package/dist/typescript/lib/credentials/OAuthCredential.d.ts +22 -0
- package/dist/typescript/lib/credentials/OAuthCredential.d.ts.map +1 -0
- package/dist/typescript/lib/credentials/PhoneAuthCredential.d.ts +8 -0
- package/dist/typescript/lib/credentials/PhoneAuthCredential.d.ts.map +1 -0
- package/dist/typescript/lib/credentials/index.d.ts +5 -0
- package/dist/typescript/lib/credentials/index.d.ts.map +1 -0
- package/dist/typescript/lib/getMultiFactorResolver.d.ts +19 -0
- package/dist/typescript/lib/getMultiFactorResolver.d.ts.map +1 -0
- package/dist/typescript/lib/index.d.ts +8 -0
- package/dist/typescript/lib/index.d.ts.map +1 -0
- package/dist/typescript/lib/modular.d.ts +360 -0
- package/dist/typescript/lib/modular.d.ts.map +1 -0
- package/dist/typescript/lib/multiFactor.d.ts +26 -0
- package/dist/typescript/lib/multiFactor.d.ts.map +1 -0
- package/dist/typescript/lib/namespaced.d.ts +12 -0
- package/dist/typescript/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/password-policy/PasswordPolicyImpl.d.ts +19 -0
- package/dist/typescript/lib/password-policy/PasswordPolicyImpl.d.ts.map +1 -0
- package/dist/typescript/lib/password-policy/PasswordPolicyMixin.d.ts +11 -0
- package/dist/typescript/lib/password-policy/PasswordPolicyMixin.d.ts.map +1 -0
- package/dist/typescript/lib/password-policy/passwordPolicyApi.d.ts +10 -0
- package/dist/typescript/lib/password-policy/passwordPolicyApi.d.ts.map +1 -0
- package/dist/typescript/lib/providers/AppleAuthProvider.d.ts +16 -0
- package/dist/typescript/lib/providers/AppleAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/EmailAuthProvider.d.ts +11 -0
- package/dist/typescript/lib/providers/EmailAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/FacebookAuthProvider.d.ts +19 -0
- package/dist/typescript/lib/providers/FacebookAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/GithubAuthProvider.d.ts +15 -0
- package/dist/typescript/lib/providers/GithubAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/GoogleAuthProvider.d.ts +21 -0
- package/dist/typescript/lib/providers/GoogleAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/OAuthProvider.d.ts +33 -0
- package/dist/typescript/lib/providers/OAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/OIDCAuthProvider.d.ts +16 -0
- package/dist/typescript/lib/providers/OIDCAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/PhoneAuthProvider.d.ts +16 -0
- package/dist/typescript/lib/providers/PhoneAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/providers/TwitterAuthProvider.d.ts +15 -0
- package/dist/typescript/lib/providers/TwitterAuthProvider.d.ts.map +1 -0
- package/dist/typescript/lib/types/auth.d.ts +305 -0
- package/dist/typescript/lib/types/auth.d.ts.map +1 -0
- package/dist/typescript/lib/types/internal.d.ts +292 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/types/namespaced.d.ts +2185 -0
- package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +2 -0
- package/dist/typescript/lib/version.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBAuthModule.android.d.ts +3 -0
- package/dist/typescript/lib/web/RNFBAuthModule.android.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBAuthModule.d.ts +406 -0
- package/dist/typescript/lib/web/RNFBAuthModule.d.ts.map +1 -0
- package/dist/typescript/lib/web/RNFBAuthModule.ios.d.ts +3 -0
- package/dist/typescript/lib/web/RNFBAuthModule.ios.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/ios/RNFBAuth/RNFBAuthModule.m +4 -2
- package/lib/ActionCodeURL.ts +174 -0
- package/lib/ConfirmationResult.ts +42 -0
- package/lib/MultiFactorResolver.ts +51 -0
- package/lib/PhoneAuthListener.ts +312 -0
- package/lib/PhoneAuthState.ts +22 -0
- package/lib/{PhoneMultiFactorGenerator.js → PhoneMultiFactorGenerator.ts} +8 -2
- package/lib/Settings.ts +59 -0
- package/lib/TotpMultiFactorGenerator.ts +78 -0
- package/lib/TotpSecret.ts +71 -0
- package/lib/{User.js → User.ts} +127 -83
- package/lib/constants.ts +55 -0
- package/lib/credentials/AuthCredential.ts +55 -0
- package/lib/credentials/EmailAuthCredential.ts +70 -0
- package/lib/credentials/OAuthCredential.ts +113 -0
- package/lib/credentials/PhoneAuthCredential.ts +66 -0
- package/lib/{providers/GithubAuthProvider.js → credentials/index.ts} +4 -19
- package/lib/getMultiFactorResolver.ts +40 -0
- package/lib/{providers/TwitterAuthProvider.js → index.ts} +14 -19
- package/lib/modular.ts +1158 -0
- package/lib/multiFactor.ts +83 -0
- package/lib/namespaced.ts +846 -0
- package/lib/password-policy/{PasswordPolicyImpl.js → PasswordPolicyImpl.ts} +37 -19
- package/lib/password-policy/PasswordPolicyMixin.ts +83 -0
- package/lib/password-policy/passwordPolicyApi.ts +60 -0
- package/lib/providers/AppleAuthProvider.ts +44 -0
- package/lib/providers/EmailAuthProvider.ts +42 -0
- package/lib/providers/FacebookAuthProvider.ts +58 -0
- package/lib/providers/GithubAuthProvider.ts +51 -0
- package/lib/providers/GoogleAuthProvider.ts +60 -0
- package/lib/providers/OAuthProvider.ts +150 -0
- package/lib/providers/OIDCAuthProvider.ts +49 -0
- package/lib/providers/PhoneAuthProvider.ts +161 -0
- package/lib/providers/TwitterAuthProvider.ts +52 -0
- package/lib/types/auth.ts +393 -0
- package/lib/types/internal.ts +474 -0
- package/lib/{index.d.ts → types/namespaced.ts} +52 -41
- package/lib/version.ts +2 -0
- package/lib/web/RNFBAuthModule.ts +1359 -0
- package/package.json +41 -9
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/tsconfig.json +26 -0
- package/tsdoc.json +22 -0
- package/typedoc.json +9 -2
- package/lib/index.js +0 -572
- package/lib/modular/index.d.ts +0 -801
- package/lib/modular/index.js +0 -651
- package/lib/providers/OAuthProvider.js +0 -70
- package/lib/providers/PhoneAuthProvider.js +0 -52
- package/lib/version.js +0 -2
- /package/lib/web/{RNFBAuthModule.android.js → RNFBAuthModule.android.ts} +0 -0
- /package/lib/web/{RNFBAuthModule.ios.js → RNFBAuthModule.ios.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDeprecationProxy","isAndroid","isBoolean","isNull","isOther","isString","isValidUrl","parseListenerOrObserver","setReactNativeModule","FirebaseModule","createModuleNamespace","getFirebaseRoot","ConfirmationResult","PhoneAuthState","PhoneAuthListener","PhoneMultiFactorGenerator","TotpMultiFactorGenerator","Settings","User","getMultiFactorResolver","MultiFactorUser","multiFactor","AppleAuthProvider","EmailAuthProvider","FacebookAuthProvider","GithubAuthProvider","GoogleAuthProvider","OAuthProvider","OIDCAuthProvider","PhoneAuthProvider","TwitterAuthProvider","version","fallBackModule","PasswordPolicyMixin","nativeEvents","statics","namespace","nativeModuleName","FirebaseAuthModule","constructor","app","config","customUrlOrRegion","_user","_settings","_authResult","_languageCode","native","APP_LANGUAGE","name","_tenantId","_projectPasswordPolicy","_tenantPasswordPolicies","_emulatorConfig","_authStateReadyPromise","_beforeAuthStateChangedCallbacks","languageCode","initialUser","APP_USER","_setUser","emitter","addListener","eventNameForApp","event","authEvent","_handleAuthStateChanged","user","phoneAuthEvent","eventKey","requestKey","type","emit","state","addAuthStateListener","addIdTokenListener","configureAuthDomain","code","Error","setLanguageCode","tenantId","setTenantId","emulatorConfig","authStateReady","Promise","resolve","unsubscribe","onAuthStateChanged","beforeAuthStateChanged","callback","onAbort","entry","push","index","indexOf","splice","updateCurrentUser","signOut","userInternal","_auth","nativeUser","pendingUser","settings","currentUser","_setUserCredential","userCredential","additionalUserInfo","listenerOrObserver","listener","subscription","then","remove","onIdTokenChanged","onUserChanged","signInAnonymously","signInWithPhoneNumber","phoneNumber","forceResend","result","verificationId","verifyPhoneNumber","autoVerifyTimeoutOrForceResend","_forceResend","_autoVerifyTimeout","verifyPhoneNumberWithMultiFactorInfo","multiFactorHint","session","uid","verifyPhoneNumberForMultiFactor","phoneInfoOptions","resolveMultiFactorSignIn","verificationCode","resolveTotpSignIn","totpSecret","createUserWithEmailAndPassword","email","password","catch","error","_recachePasswordPolicy","signInWithEmailAndPassword","signInWithCustomToken","customToken","signInWithCredential","credential","providerId","token","secret","revokeToken","authorizationCode","sendPasswordResetEmail","actionCodeSettings","_resolveActionCodeSettings","url","authDomain","options","handleCodeInApp","sendSignInLinkToEmail","isSignInWithEmailLink","emailLink","signInWithEmailLink","confirmPasswordReset","newPassword","applyActionCode","checkActionCode","fetchSignInMethodsForEmail","verifyPasswordResetCode","useUserAccessGroup","userAccessGroup","undefined","getRedirectResult","setPersistence","signInWithPopup","provider","signInWithProvider","toObject","signInWithRedirect","useDeviceLanguage","useEmulator","_url","androidBypassEmulatorUrlRemap","firebaseJson","android_bypass_emulator_url_remap","startsWith","replace","console","log","hostPortRegex","urlMatches","match","host","portString","port","parseInt","protocol","disableWarnings","getCustomAuthDomain","Object","assign","prototype","SDK_VERSION","authNamespace","hasMultiAppSupport","hasCustomUrlOrRegionSupport","ModuleClass","firebase"],"sourceRoot":"../../lib","sources":["namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,sBAAsB,EACtBC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,UAAU,EACVC,uBAAuB,QAClB,+CAA+C;AAEtD,SAASC,oBAAoB,QAAQ,8DAA8D;AACnG,SACEC,cAAc,EACdC,qBAA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A2B,EAAE,KAAK;EAClCC,WAAW,EAAErK;AACf,CAAC,CAAC;AAcF;AACA;AACA,eAAekK,aAAa;;AAE5B;AACA;AACA;AACA,OAAO,MAAMI,QAAQ,GACnBjM,eAAe,CAAC,CAKf;;AAEH;AACAH,oBAAoB,CAAC6B,gBAAgB,EAAEL,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this library except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// Minimum min password length enforced by the backend, even if no minimum length is set.
|
|
21
|
+
const MINIMUM_MIN_PASSWORD_LENGTH = 6;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Stores password policy requirements and provides password validation against the policy.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export class PasswordPolicyImpl {
|
|
29
|
+
constructor(response) {
|
|
30
|
+
// Only include custom strength options defined in the response.
|
|
31
|
+
const responseOptions = response.customStrengthOptions ?? {};
|
|
32
|
+
this.customStrengthOptions = {};
|
|
33
|
+
this.customStrengthOptions.minPasswordLength = responseOptions.minPasswordLength ?? MINIMUM_MIN_PASSWORD_LENGTH;
|
|
34
|
+
if (responseOptions.maxPasswordLength !== undefined) {
|
|
35
|
+
this.customStrengthOptions.maxPasswordLength = responseOptions.maxPasswordLength;
|
|
36
|
+
}
|
|
37
|
+
if (responseOptions.containsLowercaseCharacter !== undefined) {
|
|
38
|
+
this.customStrengthOptions.containsLowercaseLetter = responseOptions.containsLowercaseCharacter;
|
|
39
|
+
}
|
|
40
|
+
if (responseOptions.containsUppercaseCharacter !== undefined) {
|
|
41
|
+
this.customStrengthOptions.containsUppercaseLetter = responseOptions.containsUppercaseCharacter;
|
|
42
|
+
}
|
|
43
|
+
if (responseOptions.containsNumericCharacter !== undefined) {
|
|
44
|
+
this.customStrengthOptions.containsNumericCharacter = responseOptions.containsNumericCharacter;
|
|
45
|
+
}
|
|
46
|
+
if (responseOptions.containsNonAlphanumericCharacter !== undefined) {
|
|
47
|
+
this.customStrengthOptions.containsNonAlphanumericCharacter = responseOptions.containsNonAlphanumericCharacter;
|
|
48
|
+
}
|
|
49
|
+
this.enforcementState = response.enforcementState === 'ENFORCEMENT_STATE_UNSPECIFIED' ? 'OFF' : response.enforcementState ?? 'OFF';
|
|
50
|
+
|
|
51
|
+
// Use an empty string if no non-alphanumeric characters are specified in the response.
|
|
52
|
+
this.allowedNonAlphanumericCharacters = response.allowedNonAlphanumericCharacters?.join('') ?? '';
|
|
53
|
+
this.forceUpgradeOnSignin = response.forceUpgradeOnSignin ?? false;
|
|
54
|
+
this.schemaVersion = response.schemaVersion;
|
|
55
|
+
}
|
|
56
|
+
validatePassword(password) {
|
|
57
|
+
const status = {
|
|
58
|
+
isValid: true,
|
|
59
|
+
passwordPolicy: this
|
|
60
|
+
};
|
|
61
|
+
this.validatePasswordLengthOptions(password, status);
|
|
62
|
+
this.validatePasswordCharacterOptions(password, status);
|
|
63
|
+
status.isValid &&= status.meetsMinPasswordLength ?? true;
|
|
64
|
+
status.isValid &&= status.meetsMaxPasswordLength ?? true;
|
|
65
|
+
status.isValid &&= status.containsLowercaseLetter ?? true;
|
|
66
|
+
status.isValid &&= status.containsUppercaseLetter ?? true;
|
|
67
|
+
status.isValid &&= status.containsNumericCharacter ?? true;
|
|
68
|
+
status.isValid &&= status.containsNonAlphanumericCharacter ?? true;
|
|
69
|
+
return status;
|
|
70
|
+
}
|
|
71
|
+
validatePasswordLengthOptions(password, status) {
|
|
72
|
+
const minPasswordLength = this.customStrengthOptions.minPasswordLength;
|
|
73
|
+
const maxPasswordLength = this.customStrengthOptions.maxPasswordLength;
|
|
74
|
+
if (minPasswordLength !== undefined) {
|
|
75
|
+
status.meetsMinPasswordLength = password.length >= minPasswordLength;
|
|
76
|
+
}
|
|
77
|
+
if (maxPasswordLength !== undefined) {
|
|
78
|
+
status.meetsMaxPasswordLength = password.length <= maxPasswordLength;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
validatePasswordCharacterOptions(password, status) {
|
|
82
|
+
this.updatePasswordCharacterOptionsStatuses(status, false, false, false, false);
|
|
83
|
+
for (let i = 0; i < password.length; i++) {
|
|
84
|
+
const passwordChar = password.charAt(i);
|
|
85
|
+
this.updatePasswordCharacterOptionsStatuses(status, passwordChar >= 'a' && passwordChar <= 'z', passwordChar >= 'A' && passwordChar <= 'Z', passwordChar >= '0' && passwordChar <= '9', this.allowedNonAlphanumericCharacters.includes(passwordChar));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
updatePasswordCharacterOptionsStatuses(status, containsLowercaseCharacter, containsUppercaseCharacter, containsNumericCharacter, containsNonAlphanumericCharacter) {
|
|
89
|
+
if (this.customStrengthOptions.containsLowercaseLetter) {
|
|
90
|
+
status.containsLowercaseLetter ||= containsLowercaseCharacter;
|
|
91
|
+
}
|
|
92
|
+
if (this.customStrengthOptions.containsUppercaseLetter) {
|
|
93
|
+
status.containsUppercaseLetter ||= containsUppercaseCharacter;
|
|
94
|
+
}
|
|
95
|
+
if (this.customStrengthOptions.containsNumericCharacter) {
|
|
96
|
+
status.containsNumericCharacter ||= containsNumericCharacter;
|
|
97
|
+
}
|
|
98
|
+
if (this.customStrengthOptions.containsNonAlphanumericCharacter) {
|
|
99
|
+
status.containsNonAlphanumericCharacter ||= containsNonAlphanumericCharacter;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=PasswordPolicyImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MINIMUM_MIN_PASSWORD_LENGTH","PasswordPolicyImpl","constructor","response","responseOptions","customStrengthOptions","minPasswordLength","maxPasswordLength","undefined","containsLowercaseCharacter","containsLowercaseLetter","containsUppercaseCharacter","containsUppercaseLetter","containsNumericCharacter","containsNonAlphanumericCharacter","enforcementState","allowedNonAlphanumericCharacters","join","forceUpgradeOnSignin","schemaVersion","validatePassword","password","status","isValid","passwordPolicy","validatePasswordLengthOptions","validatePasswordCharacterOptions","meetsMinPasswordLength","meetsMaxPasswordLength","length","updatePasswordCharacterOptionsStatuses","i","passwordChar","charAt","includes"],"sourceRoot":"../../../lib","sources":["password-policy/PasswordPolicyImpl.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA,MAAMA,2BAA2B,GAAG,CAAC;;AAErC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,CAAmC;EAOhEC,WAAWA,CAACC,QAAwC,EAAE;IACpD;IACA,MAAMC,eAAe,GAAGD,QAAQ,CAACE,qBAAqB,IAAI,CAAC,CAAC;IAC5D,IAAI,CAACA,qBAAqB,GAAG,CAAC,CAAC;IAC/B,IAAI,CAACA,qBAAqB,CAACC,iBAAiB,GAC1CF,eAAe,CAACE,iBAAiB,IAAIN,2BAA2B;IAClE,IAAII,eAAe,CAACG,iBAAiB,KAAKC,SAAS,EAAE;MACnD,IAAI,CAACH,qBAAqB,CAACE,iBAAiB,GAAGH,eAAe,CAACG,iBAAiB;IAClF;IACA,IAA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,gCAAgC,CAACkB,QAAQ,CAACF,YAAY,CAC7D,CAAC;IACH;EACF;EAEQF,sCAAsCA,CAC5CR,MAAwC,EACxCb,0BAAmC,EACnCE,0BAAmC,EACnCE,wBAAiC,EACjCC,gCAAyC,EACnC;IACN,IAAI,IAAI,CAACT,qBAAqB,CAACK,uBAAuB,EAAE;MACtDY,MAAM,CAACZ,uBAAuB,KAAKD,0BAA0B;IAC/D;IACA,IAAI,IAAI,CAACJ,qBAAqB,CAACO,uBAAuB,EAAE;MACtDU,MAAM,CAACV,uBAAuB,KAAKD,0BAA0B;IAC/D;IACA,IAAI,IAAI,CAACN,qBAAqB,CAACQ,wBAAwB,EAAE;MACvDS,MAAM,CAACT,wBAAwB,KAAKA,wBAAwB;IAC9D;IACA,IAAI,IAAI,CAACR,qBAAqB,CAACS,gCAAgC,EAAE;MAC/DQ,MAAM,CAACR,gCAAgC,KAAKA,gCAAgC;IAC9E;EACF;AACF","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -15,11 +17,9 @@
|
|
|
15
17
|
*
|
|
16
18
|
*/
|
|
17
19
|
|
|
18
|
-
import { fetchPasswordPolicy } from
|
|
19
|
-
import { PasswordPolicyImpl } from
|
|
20
|
-
|
|
20
|
+
import { fetchPasswordPolicy } from "./passwordPolicyApi.js";
|
|
21
|
+
import { PasswordPolicyImpl } from "./PasswordPolicyImpl.js";
|
|
21
22
|
const EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION = 1;
|
|
22
|
-
|
|
23
23
|
/**
|
|
24
24
|
* Password policy mixin - provides password policy caching and validation.
|
|
25
25
|
* Expects the target object to have: _tenantId, _projectPasswordPolicy,
|
|
@@ -30,9 +30,8 @@ export const PasswordPolicyMixin = {
|
|
|
30
30
|
if (this._tenantId === null) {
|
|
31
31
|
return this._projectPasswordPolicy;
|
|
32
32
|
}
|
|
33
|
-
return this._tenantPasswordPolicies[this._tenantId];
|
|
33
|
+
return this._tenantPasswordPolicies[this._tenantId] ?? null;
|
|
34
34
|
},
|
|
35
|
-
|
|
36
35
|
async _updatePasswordPolicy() {
|
|
37
36
|
const response = await fetchPasswordPolicy(this);
|
|
38
37
|
const passwordPolicy = new PasswordPolicyImpl(response);
|
|
@@ -42,25 +41,24 @@ export const PasswordPolicyMixin = {
|
|
|
42
41
|
this._tenantPasswordPolicies[this._tenantId] = passwordPolicy;
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
|
-
|
|
46
44
|
async _recachePasswordPolicy() {
|
|
47
45
|
if (this._getPasswordPolicyInternal()) {
|
|
48
46
|
await this._updatePasswordPolicy();
|
|
49
47
|
}
|
|
50
48
|
},
|
|
51
|
-
|
|
52
49
|
async validatePassword(password) {
|
|
53
|
-
|
|
50
|
+
let passwordPolicy = this._getPasswordPolicyInternal();
|
|
51
|
+
if (!passwordPolicy) {
|
|
54
52
|
await this._updatePasswordPolicy();
|
|
53
|
+
passwordPolicy = this._getPasswordPolicyInternal();
|
|
54
|
+
}
|
|
55
|
+
if (!passwordPolicy) {
|
|
56
|
+
throw new Error('firebase.auth().validatePassword(*) Failed to load password policy for validation.');
|
|
55
57
|
}
|
|
56
|
-
const passwordPolicy = this._getPasswordPolicyInternal();
|
|
57
|
-
|
|
58
58
|
if (passwordPolicy.schemaVersion !== EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
'auth/unsupported-password-policy-schema-version: The password policy received from the backend uses a schema version that is not supported by this version of the SDK.',
|
|
61
|
-
);
|
|
59
|
+
throw new Error('auth/unsupported-password-policy-schema-version: The password policy received from the backend uses a schema version that is not supported by this version of the SDK.');
|
|
62
60
|
}
|
|
63
|
-
|
|
64
61
|
return passwordPolicy.validatePassword(password);
|
|
65
|
-
}
|
|
62
|
+
}
|
|
66
63
|
};
|
|
64
|
+
//# sourceMappingURL=PasswordPolicyMixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fetchPasswordPolicy","PasswordPolicyImpl","EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION","PasswordPolicyMixin","_getPasswordPolicyInternal","_tenantId","_projectPasswordPolicy","_tenantPasswordPolicies","_updatePasswordPolicy","response","passwordPolicy","_recachePasswordPolicy","validatePassword","password","Error","schemaVersion"],"sourceRoot":"../../../lib","sources":["password-policy/PasswordPolicyMixin.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,wBAAqB;AACzD,SAASC,kBAAkB,QAAQ,yBAAsB;AAQzD,MAAMC,uCAAuC,GAAG,CAAC;AAKjD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAA6C,GAAG;EAC3DC,0BAA0BA,CAAA,EAAkC;IAC1D,IAAI,IAAI,CAACC,SAAS,KAAK,IAAI,EAAE;MAC3B,OAAO,IAAI,CAACC,sBAAsB;IACpC;IACA,OAAO,IAAI,CAACC,uBAAuB,CAAC,IAAI,CAACF,SAAS,CAAC,IAAI,IAAI;EAC7D,CAAC;EAED,MAAMG,qBAAqBA,CAAA,EAAkB;IAC3C,MAAMC,QAAQ,GAAG,MAAMT,mBAAmB,CAAC,IAAI,CAAC;IAChD,MAAMU,cAAc,GAAG,IAAIT,kBAAkB,CAACQ,QAAQ,CAAC;IACvD,IAAI,IAAI,CAACJ,SAAS,KAAK,IAAI,EAAE;MAC3B,IAAI,CAACC,sBAAsB,GAAGI,cAAc;IAC9C,CAAC,MAAM;MACL,IAAI,CAACH,uBAAuB,CAAC,IAAI,CAACF,SAAS,CAAC,GAAGK,cAAc;IAC/D;EACF,CAAC;EAED,MAAMC,sBAAsBA,CAAA,EAAkB;IAC5C,IAAI,IAAI,CAACP,0BAA0B,CAAC,CAAC,EAAE;MACrC,MAAM,IAAI,CAACI,qBAAqB,CAAC,CAAC;IACpC;EACF,CAAC;EAED,MAAMI,gBAAgBA,CAACC,QAAgB,EAA6C;IAClF,IAAIH,cAAc,GAAG,IAAI,CAACN,0BAA0B,CAAC,CAAC;IAEtD,IAAI,CAACM,cAAc,EAAE;MACnB,MAAM,IAAI,CAACF,qBAAqB,CAAC,CAAC;MAClCE,cAAc,GAAG,IAAI,CAACN,0BAA0B,CAAC,CAAC;IACpD;IAEA,IAAI,CAACM,cAAc,EAAE;MACnB,MAAM,IAAII,KAAK,CACb,oFACF,CAAC;IACH;IAEA,IAAIJ,cAAc,CAACK,aAAa,KAAKb,uCAAuC,EAAE;MAC5E,MAAM,IAAIY,KAAK,CACb,wKACF,CAAC;IACH;IAEA,OAAOJ,cAAc,CAACE,gBAAgB,CAACC,QAAQ,CAAC;EAClD;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -15,6 +17,13 @@
|
|
|
15
17
|
*
|
|
16
18
|
*/
|
|
17
19
|
|
|
20
|
+
function getErrorMessage(error) {
|
|
21
|
+
if (error instanceof Error) {
|
|
22
|
+
return error.message;
|
|
23
|
+
}
|
|
24
|
+
return String(error);
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
/**
|
|
19
28
|
* Performs an API request to Firebase Console to get password policy json.
|
|
20
29
|
*
|
|
@@ -23,22 +32,19 @@
|
|
|
23
32
|
* @throws {Error} Throws an error if the request fails or encounters an issue.
|
|
24
33
|
*/
|
|
25
34
|
export async function fetchPasswordPolicy(auth) {
|
|
35
|
+
let response;
|
|
26
36
|
try {
|
|
27
37
|
// Identity toolkit API endpoint for password policy. Ensure this is enabled on Google cloud.
|
|
28
38
|
const baseURL = 'https://identitytoolkit.googleapis.com/v2/passwordPolicy?key=';
|
|
29
39
|
const apiKey = auth.app.options.apiKey;
|
|
30
|
-
|
|
31
|
-
const response = await fetch(`${baseURL}${apiKey}`);
|
|
32
|
-
if (!response.ok) {
|
|
33
|
-
const errorDetails = await response.text();
|
|
34
|
-
throw new Error(
|
|
35
|
-
`firebase.auth().validatePassword(*) failed to fetch password policy from Firebase Console: ${response.statusText}. Details: ${errorDetails}`,
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
return await response.json();
|
|
40
|
+
response = await fetch(`${baseURL}${apiKey}`);
|
|
39
41
|
} catch (error) {
|
|
40
|
-
throw new Error(
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
throw new Error(`firebase.auth().validatePassword(*) Failed to fetch password policy: ${getErrorMessage(error)}`);
|
|
43
|
+
}
|
|
44
|
+
if (!response.ok) {
|
|
45
|
+
const errorDetails = await response.text();
|
|
46
|
+
throw new Error(`firebase.auth().validatePassword(*) failed to fetch password policy from Firebase Console: ${response.statusText}. Details: ${errorDetails}`);
|
|
43
47
|
}
|
|
48
|
+
return await response.json();
|
|
44
49
|
}
|
|
50
|
+
//# sourceMappingURL=passwordPolicyApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getErrorMessage","error","Error","message","String","fetchPasswordPolicy","auth","response","baseURL","apiKey","app","options","fetch","ok","errorDetails","text","statusText","json"],"sourceRoot":"../../../lib","sources":["password-policy/passwordPolicyApi.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,eAAeA,CAACC,KAAc,EAAU;EAC/C,IAAIA,KAAK,YAAYC,KAAK,EAAE;IAC1B,OAAOD,KAAK,CAACE,OAAO;EACtB;EAEA,OAAOC,MAAM,CAACH,KAAK,CAAC;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeI,mBAAmBA,CACvCC,IAAgC,EACS;EACzC,IAAIC,QAAkB;EAEtB,IAAI;IACF;IACA,MAAMC,OAAO,GAAG,+DAA+D;IAC/E,MAAMC,MAAM,GAAGH,IAAI,CAACI,GAAG,CAACC,OAAO,CAACF,MAAM;IAEtCF,QAAQ,GAAG,MAAMK,KAAK,CAAC,GAAGJ,OAAO,GAAGC,MAAM,EAAE,CAAC;EAC/C,CAAC,CAAC,OAAOR,KAAK,EAAE;IACd,MAAM,IAAIC,KAAK,CACb,wEAAwEF,eAAe,CAACC,KAAK,CAAC,EAChG,CAAC;EACH;EAEA,IAAI,CAACM,QAAQ,CAACM,EAAE,EAAE;IAChB,MAAMC,YAAY,GAAG,MAAMP,QAAQ,CAACQ,IAAI,CAAC,CAAC;IAC1C,MAAM,IAAIb,KAAK,CACb,8FAA8FK,QAAQ,CAACS,UAAU,cAAcF,YAAY,EAC7I,CAAC;EACH;EAEA,OAAQ,MAAMP,QAAQ,CAACU,IAAI,CAAC,CAAC;AAC/B","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -15,22 +17,27 @@
|
|
|
15
17
|
*
|
|
16
18
|
*/
|
|
17
19
|
|
|
20
|
+
import { AuthCredential } from "../credentials/index.js";
|
|
18
21
|
const providerId = 'apple.com';
|
|
19
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use {@link OAuthProvider} with provider ID `apple.com` instead.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```js
|
|
28
|
+
* const provider = new OAuthProvider('apple.com');
|
|
29
|
+
* const credential = provider.credential({ idToken, rawNonce });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
20
32
|
export default class AppleAuthProvider {
|
|
21
33
|
constructor() {
|
|
22
34
|
throw new Error('`new AppleAuthProvider()` is not supported on the native Firebase SDKs.');
|
|
23
35
|
}
|
|
24
|
-
|
|
25
36
|
static get PROVIDER_ID() {
|
|
26
37
|
return providerId;
|
|
27
38
|
}
|
|
28
|
-
|
|
29
39
|
static credential(token, secret) {
|
|
30
|
-
return
|
|
31
|
-
token,
|
|
32
|
-
secret,
|
|
33
|
-
providerId,
|
|
34
|
-
};
|
|
40
|
+
return new AuthCredential(providerId, providerId, token, secret ?? '');
|
|
35
41
|
}
|
|
36
42
|
}
|
|
43
|
+
//# sourceMappingURL=AppleAuthProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AuthCredential","providerId","AppleAuthProvider","constructor","Error","PROVIDER_ID","credential","token","secret"],"sourceRoot":"../../../lib","sources":["providers/AppleAuthProvider.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,yBAAgB;AAG/C,MAAMC,UAAU,GAAG,WAAoB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,CAAC;EACrCC,WAAWA,CAAA,EAAG;IACZ,MAAM,IAAIC,KAAK,CAAC,yEAAyE,CAAC;EAC5F;EAEA,WAAWC,WAAWA,CAAA,EAAG;IACvB,OAAOJ,UAAU;EACnB;EAEA,OAAOK,UAAUA,CAACC,KAAa,EAAEC,MAAe,EAAsB;IACpE,OAAO,IAAIR,cAAc,CAACC,UAAU,EAAEA,UAAU,EAAEM,KAAK,EAAEC,MAAM,IAAI,EAAE,CAAC;EACxE;AACF","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
5
|
*
|
|
@@ -15,39 +17,22 @@
|
|
|
15
17
|
*
|
|
16
18
|
*/
|
|
17
19
|
|
|
20
|
+
import { createEmailAuthCredential } from "../credentials/index.js";
|
|
18
21
|
const linkProviderId = 'emailLink';
|
|
19
22
|
const passwordProviderId = 'password';
|
|
20
|
-
|
|
21
23
|
export default class EmailAuthProvider {
|
|
24
|
+
static EMAIL_LINK_SIGN_IN_METHOD = linkProviderId;
|
|
25
|
+
static EMAIL_PASSWORD_SIGN_IN_METHOD = passwordProviderId;
|
|
26
|
+
static PROVIDER_ID = passwordProviderId;
|
|
27
|
+
providerId = passwordProviderId;
|
|
22
28
|
constructor() {
|
|
23
29
|
throw new Error('`new EmailAuthProvider()` is not supported on the native Firebase SDKs.');
|
|
24
30
|
}
|
|
25
|
-
|
|
26
|
-
static get EMAIL_LINK_SIGN_IN_METHOD() {
|
|
27
|
-
return linkProviderId;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static get EMAIL_PASSWORD_SIGN_IN_METHOD() {
|
|
31
|
-
return passwordProviderId;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static get PROVIDER_ID() {
|
|
35
|
-
return passwordProviderId;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
31
|
static credential(email, password) {
|
|
39
|
-
return
|
|
40
|
-
token: email,
|
|
41
|
-
secret: password,
|
|
42
|
-
providerId: passwordProviderId,
|
|
43
|
-
};
|
|
32
|
+
return createEmailAuthCredential(email, password, passwordProviderId);
|
|
44
33
|
}
|
|
45
|
-
|
|
46
34
|
static credentialWithLink(email, emailLink) {
|
|
47
|
-
return
|
|
48
|
-
token: email,
|
|
49
|
-
secret: emailLink,
|
|
50
|
-
providerId: linkProviderId,
|
|
51
|
-
};
|
|
35
|
+
return createEmailAuthCredential(email, emailLink, linkProviderId);
|
|
52
36
|
}
|
|
53
37
|
}
|
|
38
|
+
//# sourceMappingURL=EmailAuthProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEmailAuthCredential","linkProviderId","passwordProviderId","EmailAuthProvider","EMAIL_LINK_SIGN_IN_METHOD","EMAIL_PASSWORD_SIGN_IN_METHOD","PROVIDER_ID","providerId","constructor","Error","credential","email","password","credentialWithLink","emailLink"],"sourceRoot":"../../../lib","sources":["providers/EmailAuthProvider.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,yBAAyB,QAAQ,yBAAgB;AAG1D,MAAMC,cAAc,GAAG,WAAoB;AAC3C,MAAMC,kBAAkB,GAAG,UAAmB;AAE9C,eAAe,MAAMC,iBAAiB,CAAC;EACrC,OAAgBC,yBAAyB,GAAgBH,cAAc;EACvE,OAAgBI,6BAA6B,GAAeH,kBAAkB;EAC9E,OAAgBI,WAAW,GAAeJ,kBAAkB;EAEnDK,UAAU,GAAGL,kBAAkB;EAExCM,WAAWA,CAAA,EAAG;IACZ,MAAM,IAAIC,KAAK,CAAC,yEAAyE,CAAC;EAC5F;EAEA,OAAOC,UAAUA,CAACC,KAAa,EAAEC,QAAgB,EAAuB;IACtE,OAAOZ,yBAAyB,CAACW,KAAK,EAAEC,QAAQ,EAAEV,kBAAkB,CAAC;EACvE;EAEA,OAAOW,kBAAkBA,CAACF,KAAa,EAAEG,SAAiB,EAAuB;IAC/E,OAAOd,yBAAyB,CAACW,KAAK,EAAEG,SAAS,EAAEb,cAAc,CAAC;EACpE;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this library except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { OAuthCredential } from "../credentials/index.js";
|
|
21
|
+
|
|
22
|
+
// Keep the SDK helper signature name while mapping to RNFB's native auth error type.
|
|
23
|
+
|
|
24
|
+
const providerId = 'facebook.com';
|
|
25
|
+
export default class FacebookAuthProvider {
|
|
26
|
+
static FACEBOOK_SIGN_IN_METHOD = providerId;
|
|
27
|
+
static PROVIDER_ID = providerId;
|
|
28
|
+
constructor() {
|
|
29
|
+
throw new Error('`new FacebookAuthProvider()` is not supported on the native Firebase SDKs.');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @remarks Optional `secret` for Facebook limited-login nonce behaviour (matches firebase-js-sdk).
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
static credential(token, secret) {
|
|
37
|
+
const nonce = secret ?? '';
|
|
38
|
+
return new OAuthCredential(providerId, {
|
|
39
|
+
accessToken: token,
|
|
40
|
+
rawNonce: nonce || undefined,
|
|
41
|
+
bridgeToken: token,
|
|
42
|
+
bridgeSecret: nonce
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @remarks Always returns `null` on React Native Firebase. */
|
|
47
|
+
static credentialFromResult(_userCredential) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** @remarks Always returns `null` on React Native Firebase. */
|
|
52
|
+
static credentialFromError(_error) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=FacebookAuthProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OAuthCredential","providerId","FacebookAuthProvider","FACEBOOK_SIGN_IN_METHOD","PROVIDER_ID","constructor","Error","credential","token","secret","nonce","accessToken","rawNonce","undefined","bridgeToken","bridgeSecret","credentialFromResult","_userCredential","credentialFromError","_error"],"sourceRoot":"../../../lib","sources":["providers/FacebookAuthProvider.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,yBAAgB;;AAGhD;;AAGA,MAAMC,UAAU,GAAG,cAAuB;AAE1C,eAAe,MAAMC,oBAAoB,CAAC;EACxC,OAAgBC,uBAAuB,GAAmBF,UAAU;EACpE,OAAgBG,WAAW,GAAmBH,UAAU;EAExDI,WAAWA,CAAA,EAAG;IACZ,MAAM,IAAIC,KAAK,CAAC,4EAA4E,CAAC;EAC/F;;EAEA;AACF;AACA;;EAGE,OAAOC,UAAUA,CAACC,KAAa,EAAEC,MAAe,EAAmB;IACjE,MAAMC,KAAK,GAAGD,MAAM,IAAI,EAAE;IAC1B,OAAO,IAAIT,eAAe,CAACC,UAAU,EAAE;MACrCU,WAAW,EAAEH,KAAK;MAClBI,QAAQ,EAAEF,KAAK,IAAIG,SAAS;MAC5BC,WAAW,EAAEN,KAAK;MAClBO,YAAY,EAAEL;IAChB,CAAC,CAAC;EACJ;;EAEA;EACA,OAAOM,oBAAoBA,CAACC,eAA+B,EAA0B;IACnF,OAAO,IAAI;EACb;;EAEA;EACA,OAAOC,mBAAmBA,CAACC,MAAqB,EAA0B;IACxE,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this library except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { OAuthCredential } from "../credentials/index.js";
|
|
21
|
+
|
|
22
|
+
// Keep the SDK helper signature name while mapping to RNFB's native auth error type.
|
|
23
|
+
|
|
24
|
+
const providerId = 'github.com';
|
|
25
|
+
export default class GithubAuthProvider {
|
|
26
|
+
static GITHUB_SIGN_IN_METHOD = providerId;
|
|
27
|
+
static PROVIDER_ID = providerId;
|
|
28
|
+
constructor() {
|
|
29
|
+
throw new Error('`new GithubAuthProvider()` is not supported on the native Firebase SDKs.');
|
|
30
|
+
}
|
|
31
|
+
static credential(token) {
|
|
32
|
+
return new OAuthCredential(providerId, {
|
|
33
|
+
accessToken: token,
|
|
34
|
+
bridgeToken: token,
|
|
35
|
+
bridgeSecret: ''
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** @remarks Always returns `null` on React Native Firebase. */
|
|
40
|
+
static credentialFromResult(_userCredential) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** @remarks Always returns `null` on React Native Firebase. */
|
|
45
|
+
static credentialFromError(_error) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=GithubAuthProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OAuthCredential","providerId","GithubAuthProvider","GITHUB_SIGN_IN_METHOD","PROVIDER_ID","constructor","Error","credential","token","accessToken","bridgeToken","bridgeSecret","credentialFromResult","_userCredential","credentialFromError","_error"],"sourceRoot":"../../../lib","sources":["providers/GithubAuthProvider.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,yBAAgB;;AAGhD;;AAGA,MAAMC,UAAU,GAAG,YAAqB;AAExC,eAAe,MAAMC,kBAAkB,CAAC;EACtC,OAAgBC,qBAAqB,GAAiBF,UAAU;EAChE,OAAgBG,WAAW,GAAiBH,UAAU;EAEtDI,WAAWA,CAAA,EAAG;IACZ,MAAM,IAAIC,KAAK,CAAC,0EAA0E,CAAC;EAC7F;EAEA,OAAOC,UAAUA,CAACC,KAAa,EAAmB;IAChD,OAAO,IAAIR,eAAe,CAACC,UAAU,EAAE;MACrCQ,WAAW,EAAED,KAAK;MAClBE,WAAW,EAAEF,KAAK;MAClBG,YAAY,EAAE;IAChB,CAAC,CAAC;EACJ;;EAEA;EACA,OAAOC,oBAAoBA,CAACC,eAA+B,EAA0B;IACnF,OAAO,IAAI;EACb;;EAEA;EACA,OAAOC,mBAAmBA,CAACC,MAAqB,EAA0B;IACxE,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this library except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { OAuthCredential } from "../credentials/index.js";
|
|
21
|
+
|
|
22
|
+
// Keep the SDK helper signature name while mapping to RNFB's native auth error type.
|
|
23
|
+
|
|
24
|
+
const providerId = 'google.com';
|
|
25
|
+
export default class GoogleAuthProvider {
|
|
26
|
+
static GOOGLE_SIGN_IN_METHOD = providerId;
|
|
27
|
+
static PROVIDER_ID = providerId;
|
|
28
|
+
constructor() {
|
|
29
|
+
throw new Error('`new GoogleAuthProvider()` is not supported on the native Firebase SDKs.');
|
|
30
|
+
}
|
|
31
|
+
static credential(idToken, accessToken) {
|
|
32
|
+
if (idToken == null && accessToken == null) {
|
|
33
|
+
throw new Error('At least one of ID token and access token must be non-null');
|
|
34
|
+
}
|
|
35
|
+
return new OAuthCredential(providerId, {
|
|
36
|
+
idToken: idToken ?? undefined,
|
|
37
|
+
accessToken: accessToken ?? undefined
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @remarks Always returns `null` on React Native Firebase. Credentials are not extractable from
|
|
43
|
+
* native provider sign-in results.
|
|
44
|
+
*/
|
|
45
|
+
static credentialFromResult(_userCredential) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @remarks Always returns `null` on React Native Firebase. Credentials are not extractable from
|
|
51
|
+
* native provider errors.
|
|
52
|
+
*/
|
|
53
|
+
static credentialFromError(_error) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=GoogleAuthProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OAuthCredential","providerId","GoogleAuthProvider","GOOGLE_SIGN_IN_METHOD","PROVIDER_ID","constructor","Error","credential","idToken","accessToken","undefined","credentialFromResult","_userCredential","credentialFromError","_error"],"sourceRoot":"../../../lib","sources":["providers/GoogleAuthProvider.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,yBAAgB;;AAGhD;;AAGA,MAAMC,UAAU,GAAG,YAAqB;AAExC,eAAe,MAAMC,kBAAkB,CAAC;EACtC,OAAgBC,qBAAqB,GAAiBF,UAAU;EAChE,OAAgBG,WAAW,GAAiBH,UAAU;EAEtDI,WAAWA,CAAA,EAAG;IACZ,MAAM,IAAIC,KAAK,CAAC,0EAA0E,CAAC;EAC7F;EAEA,OAAOC,UAAUA,CAACC,OAAuB,EAAEC,WAA2B,EAAmB;IACvF,IAAID,OAAO,IAAI,IAAI,IAAIC,WAAW,IAAI,IAAI,EAAE;MAC1C,MAAM,IAAIH,KAAK,CAAC,4DAA4D,CAAC;IAC/E;IAEA,OAAO,IAAIN,eAAe,CAACC,UAAU,EAAE;MACrCO,OAAO,EAAEA,OAAO,IAAIE,SAAS;MAC7BD,WAAW,EAAEA,WAAW,IAAIC;IAC9B,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;AACA;EACE,OAAOC,oBAAoBA,CAACC,eAA+B,EAA0B;IACnF,OAAO,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACE,OAAOC,mBAAmBA,CAACC,MAAqB,EAA0B;IACxE,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|