firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.8k stars 884 forks source link

Firebase 9.6.7 Web SDK returning Email badly formatted on createUserWithEmailAndPassword #6040

Open ingenious-hans opened 2 years ago

ingenious-hans commented 2 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

I am using Firebase Web SDK 9.6.7, in a Reactjs App and i am getting the error: Email adress badly formatted, this on the createUserWithEmailAndPassword methods in Auth product. And this only on Android 9, other platforms and browsers are working properly

Steps to reproduce:

  1. Create a Reactjs app
  2. Try to signin (register) using firebase 9.6.7 using Email and password

Relevant Code:

import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore'

 firebase.auth().createUserWithEmailAndPassword(this.state.USER_MAIL, this.state.USER_PASSWORD).then(async (user)=>{
    return user
  }).catch(err =>{
alert(err.code)
})
hsubox76 commented 2 years ago

In the environment where it errors (Chrome on Android 9), what does it show if you console.log this.state.USER_MAIL right before calling createUserWithEmailAndPassword?

ingenious-hans commented 2 years ago

It prints the email adress: @.***

On Wed, Mar 2, 2022, 21:18 Christina Holland @.***> wrote:

In the environment where it errors (Chrome on Android 9), what does it show if you console.log this.state.USER_MAIL right before calling createUserWithEmailAndPassword?

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-js-sdk/issues/6040#issuecomment-1057290976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AON5G3MGKY4QXY26OVNH7HTU565JDANCNFSM5PUWWFRA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

ingenious-hans commented 2 years ago

And i am able to use the same email for login with signInwithEmailAndPassword

On Wed, Mar 2, 2022, 21:20 Hans-MySql Raphanels @.***> wrote:

It prints the email adress: @.***

On Wed, Mar 2, 2022, 21:18 Christina Holland @.***> wrote:

In the environment where it errors (Chrome on Android 9), what does it show if you console.log this.state.USER_MAIL right before calling createUserWithEmailAndPassword?

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-js-sdk/issues/6040#issuecomment-1057290976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AON5G3MGKY4QXY26OVNH7HTU565JDANCNFSM5PUWWFRA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

ingenious-hans commented 2 years ago

Is this error fixed? I am getting it on Android 9

sam-gc commented 2 years ago

It seems like the issue is with the react code -- from your earlier comment it sounds like you're passing @.*** to the SDK?

ingenious-hans commented 2 years ago

Hello. No, it doesn't. Can you please try with the specified environment, Android 9, Firebase 9.6.7. Kind regards

On Tue, Jun 7, 2022, 23:14 Sam @.***> wrote:

It seems like the issue is with the react code -- from your earlier comment it sounds like you're passing @.*** to the SDK?

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-js-sdk/issues/6040#issuecomment-1149174562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AON5G3MVEU7R65UJ4CMDXV3VN63U3ANCNFSM5PUWWFRA . You are receiving this because you authored the thread.Message ID: @.***>

sam-gc commented 2 years ago

What do you mean by "badly formatted?" What specifically is wrong with the email when you call createUserWithEmailAndPassword?

ingenious-hans commented 2 years ago

I mean, firebase is returning error Email badly formatted in the catch statement where i handle errors. Please is it possible for you to try with the environment described below? Firebase 9.6.7 on web sdk android 9, using compat version

On Mon, Jun 13, 2022, 19:18 Sam @.***> wrote:

What do you mean by "badly formatted?" What specifically is wrong with the email when you call createUserWithEmailAndPassword?

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-js-sdk/issues/6040#issuecomment-1154180689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AON5G3NKLLH3CQY7DTCR6ITVO5UMTANCNFSM5PUWWFRA . You are receiving this because you authored the thread.Message ID: @.***>