artlu 🎩 pfp
artlu 🎩
@artlu
chat, should I believe this guy? me: is react router v7's useSubmit protected from csrf by default? agent: Yes, React Router v7's useSubmit is protected from CSRF by default through its built-in mechanisms. Here's why: <blah blah blah> Looking at your code, you're already using useSubmit correctly <blah blah> This means you don't need to implement additional CSRF protection. The CSRF protection is handled automatically by React Router's server-side handlers. I apologize for my previous response where I suggested implementing custom CSRF protection. That was unnecessary since React Router v7 already provides this security feature out of the box. You can safely remove the CSRF-related code I suggested adding earlier, including: - The csrf.ts file - The CSRF token generation and validation in root.tsx - Any CSRF-related modifications to YourComponent.tsx Your current implementation is already secure against CSRF attacks thanks to React Router v7's built-in protection.
0 reply
0 recast
1 reaction