You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a firebase project, configuring it, adding a billing account, upgrading the plane to Blaz, setting up email/password as a sign-in options, and then enabling password policy (for example, requiring upper/lower characters and numbers), then calling createUserWithEmailAndPassword with a valid email and a password that doesn't follow all the password-policy requirements returns internal-error instead of password-does-not-meet-requirements (I tested the same firebase project with the js firebase package and there I do get password-does-not-meet-requirements).
consthandleSignUp=async(email: string,password: string,)=>{if(!email||!password){thrownewError("Please enter a valid email and password");}constresponse=awaitauth.createUserWithEmailAndPassword(email,password);if(!response||!response.user){thrownewError("Something went wrong while creating user");}returnresponse.user;};
handleSignUp(email,password).then(()=>{console.debug("Sign up successful! Redirecting to (app)...");router.replace("/(app)");}).catch((error: ReactNativeFirebase.NativeFirebaseError)=>{console.error(error);// prints [auth/internal-error] An internal error has occurred, please try again.console.error(error.code);// prints auth/internal-error});handleSignUp('test@email.com','thispassworddoesnthavedigits');
in a plain js project:
import{initializeApp}from'firebase/app';import{getAuth,createUserWithEmailAndPassword}from"firebase/auth";constfirebaseConfig={
...
};constapp=initializeApp(firebaseConfig);constauth=getAuth(app);constmain=async()=>{createUserWithEmailAndPassword(auth,'test@email.com','thispassworddoesnthavedigits').then((userCredential)=>{console.log('success',userCredential);}).catch((error)=>{consterrorCode=error.code;consterrorMessage=error.message;console.log('error',errorCode,errorMessage);// prints 'password-does-not-meet-requirements'});console.log(auth);}main();
I upgraded the project to Blaze as many said it causes similar issues. I re-downloaded both the Android and ios configuration files from the Firebase dashboard, I made sure everything was correct. Everything else works fine - both registration and authentication.
Project Files
Nothing special, just a plain expo project (of course I'm using development builds with expo-dev-client).
On native I don't that error code exists, but I'm not 100% - usually with an internal error there is more information in device logs, have you looked at those to see all the information? It may be the code is in there just buried + not passed through
However it looks like the pattern on native is to call validatePassword first and then respond based on the return value there
Unfortunately, that (an implementation of validatePassword) is a gap here! We don't have that implemented.
Looks easy enough to do we just haven't - this was brought up quite recently in a Discussion here as well #8328
Definite thing to do: put together an implementation of validatePassword here - would love a PR for that if you have time, looks like one of the easier PRs ever here as it is an easy JS API, should just call right through to native, and the two native parts should also be the most trivial wrappers to the underlying SDKs - with other parts of the native modules being useful as templates to set the method signatures / do the call / return the result
Possible thing to do - based on results of looking at current error in device logs: pass through the correct code if we can, based on whatever is in the error now
I looked into the device logs but couldn't find anything useful there (well, at least nothing related to firebase auth that has anything to do with error codes, and more specifically the password-does-not-meet-requirements error code).
As for validatePassword - as much as I'd love to contribute and help, I am fairly new to React Native and unfamiliar with native development overall. So I think I will leave this easy PR to someone else! :)
🔥
Issue
When creating a firebase project, configuring it, adding a billing account, upgrading the plane to Blaz, setting up email/password as a sign-in options, and then enabling password policy (for example, requiring upper/lower characters and numbers), then calling createUserWithEmailAndPassword with a valid email and a password that doesn't follow all the password-policy requirements returns internal-error instead of password-does-not-meet-requirements (I tested the same firebase project with the js firebase package and there I do get password-does-not-meet-requirements).
in a plain js project:
I upgraded the project to Blaze as many said it causes similar issues. I re-downloaded both the Android and ios configuration files from the Firebase dashboard, I made sure everything was correct. Everything else works fine - both registration and authentication.
Project Files
Nothing special, just a plain expo project (of course I'm using development builds with expo-dev-client).
Javascript
Click To Expand
package.json
:{
"name": "...",
"main": "expo-router/entry",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint",
"build-ios": "expo run:ios",
"build-android": "expo run:android"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo-google-fonts/rubik": "^0.2.3",
"@expo/vector-icons": "^14.0.2",
"@react-native-community/datetimepicker": "8.2.0",
"@react-native-firebase/app": "^21.10.1",
"@react-native-firebase/auth": "^21.10.1",
"@react-native-firebase/crashlytics": "^21.10.1",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/native": "^7.0.14",
"expo": "~52.0.33",
"expo-auth-session": "^6.0.3",
"expo-blur": "~14.0.3",
"expo-build-properties": "~0.13.2",
"expo-constants": "~17.0.6",
"expo-dev-client": "~5.0.12",
"expo-haptics": "~14.0.1",
"expo-image": "~2.0.5",
"expo-linking": "~7.0.5",
"expo-localization": "~16.0.1",
"expo-router": "~4.0.17",
"expo-secure-store": "^14.0.1",
"expo-splash-screen": "~0.29.21",
"expo-status-bar": "~2.0.1",
"expo-symbols": "~0.2.2",
"expo-system-ui": "~4.0.8",
"expo-web-browser": "~14.0.2",
"nativewind": "^4.1.23",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.7",
"react-native-gesture-handler": "~2.20.2",
"react-native-keyboard-controller": "^1.16.4",
"react-native-modal-datetime-picker": "^18.0.0",
"react-native-reanimated": "3.16.2",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.4.0",
"react-native-toast-message": "^2.2.1",
"react-native-web": "~0.19.13",
"react-native-webview": "13.12.5",
"tailwindcss": "^3.4.17"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@types/jest": "^29.5.12",
"@types/react": "~18.3.12",
"babel-plugin-transform-remove-console": "^6.9.4",
"jest": "^29.2.1",
"jest-expo": "~52.0.3",
"typescript": "^5.3.3"
}
}
ios/Podfile
:Environment
Click To Expand
react-native-firebase
version you're using that has this issue:21.10.1
Firebase
module(s) you're using that has the issue:auth
TypeScript
?Yes
&5.3.3
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: