Lucia's request handler is blacklisting POST requests - why is that? #1167
Replies: 1 comment 1 reply
-
|
By default, Lucia has CSRF protection enabled, which means it’ll ignore all non-GET requests not coming from a trusted origin |
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.
-
I am using a custom express middleware to check authorization for all of my protected api routes like so:
Now, I was puzzled that my GET requests were going through but my POST requests weren't until I dug into the code. And I found a whitelist (
const whitelist = ["GET", "HEAD", "OPTIONS", "TRACE"];) that is prohibiting POST requests to get through. Is there a reason behind that decision? How can I circumnavigate that issue? Should I get the request's cookie and handle validation myself?I greatly appreciate your help!
Beta Was this translation helpful? Give feedback.
All reactions