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
Also this part seems to be outdated(v8 SDK yet shown up in a v9 page)
like auth.signInWithPopup(OAuthprovider) should be signInWithPopup(authInstance,OAuthProvider), so should auth.signInWithEmailAndPassword(email, password) (first arg: auth instance)... etc.
Please confirm if I did everything right: I filled in two forms with screenshot and details but the feedback system seems not to be user-friendly. I cannot get and feedback(of update) of my feedback. The two feedback forms are about last <li> and the official doc page
Steps to reproduce:
Create an account in GitHub with a email userEmail.
Create an account in Firebase Auth with same email userEmail.
Setup Firebase OAuth with GitHub
Login with OAuth. Then you'll get an Error authErr with error code AuthErrorCodes.NEED_CONFIRMATION === "auth/account-exists-with-different-credential"
This authErr should be with type AuthError but doesn't have the properties (like email) in official doc
In the productive module node_modules\@firebase\auth\dist\auth-public.d.ts, this type is defined same as official doc,
Relevant Code:
These following two points are the reason why I think AuthError Class needs a change.
Current master branch code for AuthError, extending FirebaseError
try{constghAccessToken=awaitsignInWithPopup(auth,ghaProvider);}catch(err: any){if(err.code===FireAuthErrorCode.NEED_CONFIRMATION){for(letkofObject.getOwnPropertyNames(err)){console.log("error",k,err[k]);/* Here it shows clearly that the err doesn't have the properties of `AuthError`. Instead, it has a customData field with same properties extended in `AuthError` */}}else{console.error("uncaught Error");throwerr;}}
I wrote this feedback on official doc
detail
When I use "firebase": "^9.1.2" with TypeScript, the err, thrown from signInWithPopup with error code AuthErrorCodes.NEED_CONFIRMATION === "auth/account-exists-with-different-credential", has the same structure as Firebase error with fields {code,name,message,stack}. The extended part is a customData property. customData is an Object with properties: {appName, email, _tokenResponse}. My currUser doesn't have phoneNumber or tenantId(because I'm using popup not redirect).
what I think it should be
Class AuthError extends FirebaseError with Properties: customData, with type AuthErrorData(Object)
Class AuthErrorData extends Object with properties in this paged
The text was updated successfully, but these errors were encountered:
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Data structure different in production environment than in official doc and source code.
like
auth.signInWithPopup(OAuthprovider)
should besignInWithPopup(authInstance,OAuthProvider)
, so shouldauth.signInWithEmailAndPassword(email, password)
(first arg: auth instance)... etc.<li>
and the official doc pageSteps to reproduce:
userEmail
.userEmail
.authErr
with error codeAuthErrorCodes.NEED_CONFIRMATION === "auth/account-exists-with-different-credential"
authErr
should be with typeAuthError
but doesn't have the properties (likeemail
) in official docnode_modules\@firebase\auth\dist\auth-public.d.ts
, this type is defined same as official doc,Relevant Code:
These following two points are the reason why I think
AuthError
Class needs a change.Current master branch code for
AuthError
, extendingFirebaseError
firebase-js-sdk/packages/auth/src/model/public_types.ts
Lines 123 to 139 in 53a9263
Current
FirebaseError
type definition, with optionalcustomData
but noemail
,phoneNumber
, etc.firebase-js-sdk/packages/util/src/errors.ts
Lines 74 to 94 in 53a9263
Code for reproduce error, step 4 and step 5
I wrote this feedback on official doc
detail
When I use "firebase": "^9.1.2" with TypeScript, the
err
, thrown from signInWithPopup with error codeAuthErrorCodes.NEED_CONFIRMATION === "auth/account-exists-with-different-credential"
, has the same structure as Firebase error with fields {code,name,message,stack}. The extended part is acustomData
property.customData
is an Object with properties: {appName, email, _tokenResponse}. MycurrUser
doesn't have phoneNumber or tenantId(because I'm using popup not redirect).what I think it should be
Class
AuthError
extendsFirebaseError
with Properties:customData
, with typeAuthErrorData
(Object)Class
AuthErrorData
extendsObject
with properties in this pagedThe text was updated successfully, but these errors were encountered: