-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[question] Shouldn't /csrfToken route match "first", before what's in config/routes.js and config/blueprints.js #2360
Comments
Unfortunately no.
So you have to handle this outside of sails csrf configuration. |
Would this thread be a legitimate request to leave the issue open? if not, just close it. |
The main issue at play here is that, for better or worse, routes in
@akhoury, if you want to experiment with that and issue a pull request, I'd be grateful! |
Will do |
@sgress454 |
@konstantinzolotarev that's a separate issue. If you want to set up the CSRF hook to be configurable in that way and submit a PR, feel free! |
@sgress454 Done. and also applied |
In a SPA using pushState, I made some changes to the routes to forward all requests except assets and api request to the main homepage view, where Backbone will pickup the requested route, with excellent help from @sgress454
However, when CSRF (with ajax) is enabled,
/csrfToken
was being treated just all other routes, the request was never making it to its destination.I realize that with my catch-all routes
/*
config this was very easy to debug, however, I am not sure if that's the best approach.Question:
Shouldn't
/csrfToken
have a precedence over what's in theconfig.routes
? if not, should be at least have an option to use a different route, something likeinstead of doing this?
config/routes.js
Thank you
The text was updated successfully, but these errors were encountered: