-
Notifications
You must be signed in to change notification settings - Fork 47
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
AstroAuthHandler attempts to modify immutable headers #65
Comments
Nevermind. I guess I was doing something wrong in my configuration. Everything is working now. |
Did you figure out what you were doing wrong? I'm having this same issue with the slack integration. |
Did you figure out what was wrong I am getting the same error.
|
I was able to fix it for me by adding a few config options as described here: #58 (comment). I hope that works for you! |
Using Credentials Provider with auth-astro along with the default signin page to handle authentication against an existing API that returns a cookie. This invokes AstroAuthHandler in server.ts, which attempts to extract cookies from the included with the response provided by the call to Auth. This causes a CredentialsSignin error because the attempt to delete the set-cookie header fails due to the headers being immutable.
I think this can be fixed by extracting the headers into a new object, extracting the cookies and removing the set-cookie header, and then creating a new response with the returned body and modified headers.
I patched the module in my local environment and it seems to work:
I hope to submit a PR with this fix as soon as I get the module built in my environment so I can run tests.
The text was updated successfully, but these errors were encountered: