Skip to content

Flash messages are null when using a try/catch block to conditionally redirect the user #3677

Answered by finestgecko
finestgecko asked this question in Help
Discussion options

You must be logged in to vote

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().

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by finestgecko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant