gladly-team / next-firebase-auth

Simple Firebase authentication for all Next.js rendering strategies
https://nfa-example-git-v1x-gladly-team.vercel.app/
MIT License
1.34k stars 290 forks source link

[Only on ios chrome] Error: The request must have an Authorization header value, or you should explicitly provide an ID token to "setAuthCookies". #523

Closed luudv closed 2 years ago

luudv commented 2 years ago

Describe the bug Hi, I have used your plugin for my app authentication. The app works fine on other browsers except chrome on iOS. I checked the log and got this error:

2022-08-04_3-15-11 PM

Versions

next-firebase-auth version: 9.9.0 Firebase JS SDK: 1.0.0-canary.11 Next.js: 12.2.3

kmjennison commented 2 years ago

Could you provide code and a live reproduction?

You should double-check that your call to setAuthCookies has an Authorization header value set to the user's ID token.

luudv commented 2 years ago

Could you provide code and a live reproduction?

You should double-check that your call to setAuthCookies has an Authorization header value set to the user's ID token.

Thanks for the response, I basically configured the same as your example https://github.com/gladly-team/next-firebase-auth/blob/main/example/utils/initAuth.js . Using loginAPIEndpoint and logoutAPIEndpoint and don't use tokenChangedHandler. I have tested browsers on mobile and desktop. Only the chrome browser on IOS is not working, I don't know why.

kmjennison commented 2 years ago

@luudv Have you tried the live demo of the example app? https://nfa-example.vercel.app/ It works for me on Chrome iOS.

kmjennison commented 2 years ago

Closing until there's a clear way to reproduce.

ancashoria commented 1 year ago

I'm also having this issue. You can reproduce it here: https://app.herewith.eu/sign-in (sign in with phone number on iOS / chrome)

jodik commented 1 year ago

Same story, the demo https://nfa-example.vercel.app/ does not use 1.0.canary versions Only affects chrome on iOS