Replies: 1 comment 1 reply
-
Same here, any news on this? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm experiencing an issue with NextAuth.js (v4) in a Next.js 13 app when the site is embedded in an iframe.
✅ Expected Behavior: Login should work the same inside and outside an iframe.
❌ Actual Behavior: When embedded in an iframe, users get redirected back to the login page after attempting to sign in. Outside the iframe, login works fine.
Debugging Attempts:
1. Identified a possible issue with the
Referrer-Policy
headerReferrer-Policy: strict-origin-when-cross-origin
causes a400 Bad Request
from nginx when calling/api/auth/providers
.2. Tried modifying headers in Next.js via
headers()
API:3. Tried modifying iframe attributes to loosen restrictions:
4. Tried modifying the NextAuth API route to remove headers:
Initially, I tried modifying
[...nextauth].ts
to removeReferrer-Policy
, but I wasn't sure if the function was executing.However, after testing further, the function does apply, but now I get a new error even when not using an iframe:
Here’s the updated
[...nextauth].ts
function:CLIENT_FETCH_ERROR
when NextAuth tries to fetch/api/auth/session
.Open Questions:
Referrer-Policy
header?[...nextauth].ts
result in aCLIENT_FETCH_ERROR
for/api/auth/session
?Any help or suggestions would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions