-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Authorize according to API key (if given) over cookies #3877
Conversation
@@ -41,6 +41,10 @@ def sign(key, path, expires): | |||
|
|||
@login_manager.user_loader | |||
def load_user(user_id_with_identity): | |||
user = api_key_load_user_from_request(request) | |||
if user: | |||
return user |
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.
This feels almost as too simple 😆
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.
I've battled flask_login for like 8 hours, trying to get it to cooperate with user_loader
and request_loader
until this hit me 🤦♂️
|
@arikfr I CURLed this around, and there are no |
* remove legacy session identifier support * remove redundant test * redirect to login to support any invalid session identifiers * be more specific with caught errors * use authorization according to api_key (if provided) over session
What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
Fixes #3770
Mobile & Desktop Screenshots/Recordings (if there are UI changes)