Some more update to the code.
No messages are shown if the email flash is not defined.
Added a success message immediately after the user changes his/her password.
Optimized the sign-in UX a little bit more.