*auth.is_logged_in()* will return a bool object. True for authenticated user and I belive *auth.user_id* attribute is None for the non authenticated user. *auth *being the Auth class instance created by the welcome scaffolding application.
You could use the returned values to catch unsuccessful authentication and redirect to the correct action There is an Auth setting for failed authentication (for example, it's possible to call a function on failed login) ("Settings and Messages", web2py book 4th edition, 9.3.7) auth.settings.on_failed_authentication = lambda url: redirect(url) On Saturday, May 5, 2012 9:51:23 AM UTC-3, Rhys wrote: > > I'm creating a custom drop down login form for all pages where the user > isn't logged in. Once they try and login through this form if it > is unsuccessful it redirects to the /user/login page with the auth.login > form. How do I get a error if the login has resulted in an invalid login. > As there are two forms I've tried also tried to do a form out of html so > there is no form key. Still no luck. Is it s simple variable I can use to > determine if it is successful?