SaturnFramework / Saturn

Opinionated, web development framework for F# which implements the server-side, functional MVC pattern
https://saturnframework.org
MIT License
714 stars 108 forks source link

add a tryCsrf handler as well as the csrf handler #175

Closed baronfel closed 5 years ago

baronfel commented 5 years ago

We should allow users to define their own csrf-recovery handlers, so I made tryCsrf and then implemented csrf in terms of that.

By default all of the same error-handling occurs, but I took the opportunity to make a type out of the errors so that users could figure out what they wanted to do.

baronfel commented 5 years ago

This came up as we were migrating some stuff at work from Nancy to Giraffe/Saturn, and we realized we had different responses to CSRF token errors in different places.