Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
signals.py62 linesDownload Raw Back to flask_login
1from flask.signals import Namespace2 3_signals = Namespace()4 5#: Sent when a user is logged in. In addition to the app (which is the6#: sender), it is passed `user`, which is the user being logged in.7user_logged_in = _signals.signal("logged-in")8 9#: Sent when a user is logged out. In addition to the app (which is the10#: sender), it is passed `user`, which is the user being logged out.11user_logged_out = _signals.signal("logged-out")12 13#: Sent when the user is loaded from the cookie. In addition to the app (which14#: is the sender), it is passed `user`, which is the user being reloaded.15user_loaded_from_cookie = _signals.signal("loaded-from-cookie")16 17#: Sent when the user is loaded from the header. In addition to the app (which18#: is the #: sender), it is passed `user`, which is the user being reloaded.19_user_loaded_from_header = _signals.signal("loaded-from-header")20 21#: Sent when the user is loaded from the request. In addition to the app (which22#: is the #: sender), it is passed `user`, which is the user being reloaded.23user_loaded_from_request = _signals.signal("loaded-from-request")24 25#: Sent when a user's login is confirmed, marking it as fresh. (It is not26#: called for a normal login.)27#: It receives no additional arguments besides the app.28user_login_confirmed = _signals.signal("login-confirmed")29 30#: Sent when the `unauthorized` method is called on a `LoginManager`. It31#: receives no additional arguments besides the app.32user_unauthorized = _signals.signal("unauthorized")33 34#: Sent when the `needs_refresh` method is called on a `LoginManager`. It35#: receives no additional arguments besides the app.36user_needs_refresh = _signals.signal("needs-refresh")37 38#: Sent whenever the user is accessed/loaded39#: receives no additional arguments besides the app.40user_accessed = _signals.signal("accessed")41 42#: Sent whenever session protection takes effect, and a session is either43#: marked non-fresh or deleted. It receives no additional arguments besides44#: the app.45session_protected = _signals.signal("session-protected")46 47 48def __getattr__(name):49    if name == "user_loaded_from_header":50        import warnings51 52        warnings.warn(53            "'user_loaded_from_header' is deprecated and will be"54            " removed in Flask-Login 0.7. Use"55            " 'user_loaded_from_request' instead.",56            DeprecationWarning,57            stacklevel=2,58        )59        return _user_loaded_from_header60 61    raise AttributeError(name)62 
codekingpro/portable-devtools · Team Ai