Skip to content

Commit

Permalink
fix: flash input data on CSRF error
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 22, 2024
1 parent bbb1d94 commit 0273f51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/errors.ts
Expand Up @@ -18,6 +18,7 @@ export const E_BAD_CSRF_TOKEN = class InvalidCSRFToken extends Exception {
message = 'Invalid or expired CSRF token'

async handle(error: InvalidCSRFToken, ctx: HttpContext) {
ctx.session.flashExcept(['_csrf', '_method', 'password', 'password_confirmation'])
ctx.session.flashErrors({
[error.code]: error.message,
})
Expand Down

0 comments on commit 0273f51

Please sign in to comment.