Closed OsoThevenin closed 2 weeks ago
@OsoThevenin This was happening to me too. I spent quite a while working through the code and realised the way AuthJS was setting the hostname was a bit odd. The weird url is actually the HOST of the server.
I can't recall exactly how I worked around the issue but it was either setting the AUTH_URL or the AUTH_REDIRECT_PROXY_URL to the actual domain i.e. "https://
See this issue https://github.com/nextauthjs/next-auth/issues/10928#issuecomment-2121092912
@OsoThevenin This was happening to me too. I spent quite a while working through the code and realised the way AuthJS was setting the hostname was a bit odd. The weird url is actually the HOST of the server.
I can't recall exactly how I worked around the issue but it was either setting the AUTH_URL or the AUTH_REDIRECT_PROXY_URL to the actual domain i.e. "https:///api/auth"
See this issue nextauthjs/next-auth#10928 (comment)
Definitely this helped fix the issue. Thanks a lot @alasdairmackenzie ❤️
Describe the bug
After the user is successfully logged in on my duende identity server v6, it tries to redirect the user to the specified callback url (following the Auth.js documentation here).
Here's an example redirect url:\ \ https://mydomain/api/auth/callback/duende-identity-service?code=3D96EBB5721191CD18CDBBFE5FFD818017E4C59F09214552AE74636913DB21B6-1&scope=openid profile email&session_state=G2eqKlEXsiOGOl0W5zNmDk7MloXu18w1M3YapSqv7qI.E986B1AED0AC76CFE51406215F9A08F6&iss=myidentityserver
My SWA instead of retrieving the session and redirecting back the user to the "dashboard" it returns a 302 status code with this weird url as location. https://1dd4069c374e:8080/api/auth/error?error=Configuration
On localhost the redirect works as expected.
To Reproduce\ Can't give much details of the code as it's private. But will try to create a mock application to replicate this behaviour.
auth.config.ts
middleware.ts
staticwebapp.config.json
Expected behavior\ Location should be https://mydomain/dashboard
Actual response:
Device info (if applicable):