I suppose you could do: if response.flash == auth.messages.invalid_login:
Otherwise, you can create an auth.settings.login_onfail callback, which can then set a flag in the session indicating login has failed (or redirect somewhere). Anthony On Sunday, February 16, 2014 10:26:45 AM UTC-5, desta wrote: > > Hey Anthony thanks for the reply. > > Yes I am using the auth.login() using a custom form. I am not using the > flash message so if the user enters the wrong password the page just > reloads without any indication of the login failure. Isn't there another > way to find out if the login failed, so I can notify the user? > > Thank you! > > On Saturday, February 15, 2014 8:29:56 PM UTC+2, Anthony wrote: >> >> Depends on how you have customized the login. If you want to create a >> completely custom form and workflow, you can use auth.login_bare() to do >> the login -- it returns False if the login fails. If you want to use >> auth.login(), upon login failure, it automatically redirects back to the >> login page and displays a flash message. You can customize the flash >> message via auth.messages.invalid_login. >> >> Anthony >> >> On Saturday, February 15, 2014 11:32:58 AM UTC-5, desta wrote: >>> >>> Hello, >>> >>> I am building a custom *Login *form and I want to warn the user if >>> his/her username/pass are wrong. How can I detect this? >>> I tried through *form.errors* but its not there. I can understand that >>> since its not error of the form but of authentication. >>> >>> Thank you. >>> >>> >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

