login validation

47 views
Skip to first unread message

Andrea Fae'

unread,
Aug 30, 2020, 8:11:08 AM8/30/20
to web2py-users
Hello, maybe it's easy but I don't know exactly if it's possible.
I want that a user can login ONLY if its rescord has is_valid=True. I dont' want he logins if is_valid=False in the auth_user table...
Is it possible? In which way? thank you

Clemens

unread,
Aug 30, 2020, 8:27:29 AM8/30/20
to web2py-users
Have a look here:
http://web2py.com/books/default/chapter/29/09/access-control#Decorators

Should be something like
@auth.requires(auth.is_valid==True)

Paco Bernal

unread,
Aug 30, 2020, 6:08:32 PM8/30/20
to web2py-users
Hi
If you set at anytime key_registration='blocked' in auth_user table that user will not be able to loging. 
That's the way I would do it
Regards

Paco Bernal

unread,
Aug 31, 2020, 2:46:15 AM8/31/20
to web2py-users

Andrea Fae'

unread,
Aug 31, 2020, 7:05:35 AM8/31/20
to web2py-users
I noted in the manual. But for your opinion what is the meaning about is_active in auth_user?
Why is it useful?
Thank you

Paco Bernal

unread,
Aug 31, 2020, 7:13:14 AM8/31/20
to web2py-users
Hi,
I don't know about an "is_active" field in auth_user table, only regarding Record versioning, but I don't use it.
Regards
Reply all
Reply to author
Forward
0 new messages