You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After successful authentication, What is the type of g.flask_httpauth_user that is added by the @login_required decorator?
I expect to find user object, But As I can understand from the source code, It is always str or None. In the case of string it will be the username.
If my note is true, It will is better to change this behavior to store user object. If this will break the backword compatibility, I suggest to add optional user loader callback, that will be called after successful login.
The current behavior break the example mentioned :
The g.flask_httpauth_user attribute is not public, you are not supposed to use it directly. The basic_auth.current_user() method returns the user object that you returned in the verify_password callback.
@tabebqena You can access a lot of things that you are not supposed to use directly. g.flask_httpauth_user is not documented, so when something is not in the documentation it means that you use it at your own risk. I do not have an obligation to preserve it in future releases.
After successful authentication, What is the type of g.flask_httpauth_user that is added by the
@login_required
decorator?I expect to find
user
object, But As I can understand from the source code, It is alwaysstr
orNone
. In the case of string it will be theusername
.If my note is true, It will is better to change this behavior to store
user
object. If this will break the backword compatibility, I suggest to add optional user loader callback, that will be called after successful login.The current behavior break the example mentioned :
basic_auth.current_user()
return theg.flask_httpauth_user
which has no method namedget_token()
Thank you.
Version: 4.4.0
The text was updated successfully, but these errors were encountered: