Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions superset/security/guest_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class GuestUser(AnonymousUserMixin):
"""

is_guest_user = True
active = True
Comment on lines 61 to +62
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flask-Login interface violation

The added active = True class attribute does not implement the required Flask-Login is_active property. Flask-Login expects user classes to provide an is_active property (not a class attribute) that returns a boolean indicating whether the user account is active. This mismatch will cause authentication failures when Flask-Login checks current_user.is_active for guest users. Replace the class attribute with a proper @property method is_active that returns True, ensuring compatibility with Flask-Login's user interface requirements.

Code suggestion
Check the AI-generated fix before applying
Suggested change
is_guest_user = True
active = True
is_guest_user = True
@property
def is_active(self) -> bool:
return True

Code Review Run #fe6ce1


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

@sadpandajoe sadpandajoe Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be active or is_active?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with active = True and confirmed it fixes the issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah the error is:

if current_user.is_authenticated and current_user.active:

so it should be like this, but can you add the is_active also like:

    @property
    def is_active(self):
        return self.active

Looking at it, it does seem that FAB should be using is_active instead of active, I'll make the change.


@property
def is_authenticated(self) -> bool:
Expand Down
Loading