Closed gemerden closed 2 years ago
The get_user_roles
callback takes the user object that you return in your verify_password callback as argument. If you do not return a user object and instead return True
, then it passes the auth object as argument, so that you have access to the username/password in checking your roles.
So changing your verify_password to return the user should address your concern, I think.
Very clear, thanks.
Hmm ... maybe put the explanation in the docs ;-)
Yes,you first read all terms and conditions.Then,you ask questions on documentations because a developer has restrictions regarding this terms and conditions.
@miguelgrinberg Thought you might be busy with some other important stuff. Would be happy to make edits if required.
Hi Miguel,
(remember me, i made the roles PR)
I am trying to upgrade (finally) to the new version version with the integrated roles based access control (login_required(role=[...)) and i noticed that the @auth.get_user_roles(user) callback takes auth as parameter. I was wondering whether it is not more consistent to use 'username' or 'username' and 'password' as parameters, as in @auth.verify_password (took me a while to figure it out and it is not very clear from readthedocs).
Maybe you had a specific reason?
Cheers, Lars