forked from puiterwijk/flask-oidc
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add signals to hook into the login and logout process
Signed-off-by: Aurélien Bompard <[email protected]>
- Loading branch information
Showing
6 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SPDX-FileCopyrightText: 2023 Aurélien Bompard <[email protected]> | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
|
||
""" | ||
This module contains signals that can be connected to to hook into the login and logout process. | ||
See the `Flask documentation on signals <https://flask.palletsprojects.com/en/2.3.x/signals/>`_ | ||
to learn how to connect to these. | ||
""" | ||
|
||
|
||
from blinker import Namespace | ||
|
||
# This namespace is only for signals provided by flask-oidc. | ||
_signals = Namespace() | ||
|
||
before_login_redirect = _signals.signal("before-login-redirect") | ||
"""Emitted before the user is redirected to the identity provider.""" | ||
|
||
before_authorize = _signals.signal("before-authorize") | ||
"""Emitted when the user is redirected back from the identity provider.""" | ||
|
||
after_authorize = _signals.signal("after-authorize") | ||
"""Emitted when the user is authenticated.""" | ||
|
||
before_logout = _signals.signal("before-logout") | ||
"""Emitted before the user is logged out.""" | ||
|
||
after_logout = _signals.signal("after-logout") | ||
"""Emitted after the user is logged out.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters