Skip to content

Let action return 401 or 403 #814

Answered by tats-u
tats-u asked this question in Q&A
Oct 31, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Worked well by:

return data(submission.reply({formErros: ["ID or password incorrect."]}), 401);
  • Don't throw, just return.
  • submission.reply returns just a JSON-compatible object.
  • I tried it in an environment where the v3_singleFetch is enabled. This is why I used data instead of json. I have never tried in those without it.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tats-u
Comment options

@tats-u
Comment options

Answer selected by tats-u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants