https://github.com/kentcdodds/epic-stack-with-csrf
An example of the Epic Stack with CSRF protection on forms
https://github.com/kentcdodds/epic-stack-with-csrf
epic-stack epic-stack-example
Last synced: 11 months ago
JSON representation
An example of the Epic Stack with CSRF protection on forms
- Host: GitHub
- URL: https://github.com/kentcdodds/epic-stack-with-csrf
- Owner: kentcdodds
- Created: 2023-06-14T20:26:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-20T14:03:16.000Z (over 2 years ago)
- Last Synced: 2025-04-23T00:08:27.714Z (11 months ago)
- Topics: epic-stack, epic-stack-example
- Language: TypeScript
- Homepage:
- Size: 4.59 MB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Epic Stack with CSRF Protection
This is an example of how to integrate the
[`remix-utils`](https://github.com/sergiodxa/remix-utils) package utilities for
[Cross-Site Request Forgery (CSRF)](https://en.wikipedia.org/wiki/Cross-site_request_forgery)
protection with the Epic Stack. The easiest way to explore the example is to
pull up
[the commit history](https://github.com/kentcdodds/epic-stack-with-csrf/commits/main).
Following the steps laid out in the Remix Utils docs is sufficient for this:
1. Install `remix-utils`
2. Generate the authenticity token in the `root.tsx` loader (be certain to
commit the session to set the cookie)
3. Wrap the App in the `` and provide the token
4. Render a Form with the `` component
5. Verify in the Action using `verifyAuthenticityToken` and the session.