Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Auth is failing on Safari 16.1 (destructuring error) #6636

Closed
koush opened this issue Sep 28, 2022 · 6 comments
Closed

Firebase Auth is failing on Safari 16.1 (destructuring error) #6636

koush opened this issue Sep 28, 2022 · 6 comments

Comments

@koush
Copy link

koush commented Sep 28, 2022

  • Operating System version: MacOS 13 or iOS 16
  • Browser version: Safari 16.1
  • Firebase UI version: Latest
  • Firebase SDK version: Latest

[REQUIRED] Describe the problem

Firebase UI does not work with Safari on Mac or iPhone.

Steps to reproduce:

  1. Go to https://fir-ui-demo-84a6c.firebaseapp.com/. This is the project's own login demo page.
  2. Try to log in on Mac or iPhone.
  3. Login hangs.

Additionally: these steps work fine with Chrome on the same Mac.

Relevant Code:

N/A

Seen in console:

TypeError: Right side of assignment cannot be destructured

 async onAuthEvent(event: AuthEvent): Promise<void> {
    // this line
    const { urlResponse, sessionId, postBody, tenantId, error, type } = event;
    if (error) {
      this.reject(error);
      return;
    }

The event it is receiving seems to be a window Message event, and not the JSON contained within data which is what contains the fields to be destructured.

image

Crosspost from firebase/firebaseui-web#977

I believe the bug is in the js sdk as the relevant file is in this source file:

const { urlResponse, sessionId, postBody, tenantId, error, type } = event;

From my understanding of the stack trace, I think the js sdk uses iframes to communicate, and there's some sort of message passing failure happening.

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@prameshj
Copy link
Contributor

prameshj commented Oct 7, 2022

I see this with Safari 16.0 too.. But the modular demo app and the auth-compat demo app from firebase-js-sdk are working ok for me.

Closing this and leaving the firebaseui issue open.

@prameshj prameshj closed this as completed Oct 7, 2022
@mmmulani
Copy link

we're seeing the same issue with Safari 16.1 beta and we don't use firebaseui, only standard firebase-js-sdk.

@koush
Copy link
Author

koush commented Oct 20, 2022

we're seeing the same issue with Safari 16.1 beta and we don't use firebaseui, only standard firebase-js-sdk.

I ended up using a workaround by managing the auth redirects myself. This also provides an offramp for firebase, if you're only using the js sdk for auth. firebase/firebaseui-web#977 (comment)

@sww314
Copy link

sww314 commented Oct 25, 2022

This should still be open. We are still seeing the issue.

@samsargent
Copy link

Can also confirm we're seeing this with just the firebase-js-sdk (not using firebaseui).

If it helps, switching tosignInWithPopup works. signInWithRedirect doesn't work.

@firebase firebase locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants