-
Notifications
You must be signed in to change notification settings - Fork 16.6k
fix(security): Add active property to guest user #35454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,7 @@ class GuestUser(AnonymousUserMixin): | |
| """ | ||
|
|
||
| is_guest_user = True | ||
| active = True | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would help if we can provide a bit more context as of why this issue came into existence and how this fixes it?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tagged @dpgaspar as a reviewer because i think a recent FAB update caused this.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah the error is: so it should be like this, but can you add the is_active also like: @property
def is_active(self):
return self.activeLooking at it, it does seem that FAB should be using |
||
|
|
||
| @property | ||
| def is_authenticated(self) -> bool: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added
active = Trueclass attribute does not implement the required Flask-Loginis_activeproperty. Flask-Login expects user classes to provide anis_activeproperty (not a class attribute) that returns a boolean indicating whether the user account is active. This mismatch will cause authentication failures when Flask-Login checkscurrent_user.is_activefor guest users. Replace the class attribute with a proper@propertymethodis_activethat returnsTrue, ensuring compatibility with Flask-Login's user interface requirements.Code suggestion
Code Review Run #fe6ce1
Should Bito avoid suggestions like this for future reviews? (Manage Rules)