A tuple with the token and the string to send in Set-Cookie If there's already a csrf value in the cookie then the token will be the same and the cookie will be null.
Verify if a request and cookie has a valid CSRF token.
export async function action({ request }: ActionFunctionArgs) {
await csrf.validate(request);
// the request is authenticated and you can do anything here
}
Verify if a request and cookie has a valid CSRF token.
export async function action({ request }: ActionFunctionArgs) {
await csrf.validate(request);
// the request is authenticated and you can do anything here
}
Generates a token and serialize it into the cookie.