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
{{ message }}
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
Hi. I have a working setup using MongoEngine and I would like to set 'is_authenticated' in the database instead of always returning true. I tried to load login_user as _login_user, and wrap that, but mine is not being invoked.
What is the right way to do this? I was thinking of the reverse for logout_user.
from flask_security import login_user as _login_user
def login_user(user, remember=None):
print("My Login User Running!")
user.authenticated = True
return _login_user(user, remember=None):
The text was updated successfully, but these errors were encountered:
You should be able to use the login_manager signals - 'user_logged_in' and 'user_logged_out'.
Off question - without knowing anything about your app - this seems like a terrible idea - there are too many ways things could crash that would have 'is_authenticated' in the DB forever. But you say 'instead of always returning true' - so maybe there is something else going on - who wants to know if they are authenticated? if they get a 404 response from an API - they know!
It's more from an administration standpoint.
If I want to know 'whose logged in right now', I don't really have a way of getting that from the database.
That seems like an attainable piece of information.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi. I have a working setup using MongoEngine and I would like to set 'is_authenticated' in the database instead of always returning true. I tried to load login_user as _login_user, and wrap that, but mine is not being invoked.
What is the right way to do this? I was thinking of the reverse for logout_user.
The text was updated successfully, but these errors were encountered: