Flash messages are null when using a try/catch block to conditionally redirect the user #3677
-
I'm following the guide for validating server side forms but it's unclear how to conditionally redirect a user:
With the code below,
I wondered if error messages should be set manually with If I try without the
Here are my routes:
I would be grateful for any advice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved:When I used For some reason, I had the assumption that this would also happen with In this instance, flash messages should be manually created using |
Beta Was this translation helpful? Give feedback.
Solved:
When I used
request.validate()
to create a user, I did not need to explicitly define flash messages, this was handled behind the scenes.For some reason, I had the assumption that this would also happen with
auth.use('web').attempt(email, password)
, but it seems this is not the case.In this instance, flash messages should be manually created using
session.flash()
.