Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Use new Flask-Login request_loader to set request callback #858

Closed
wants to merge 1 commit into from

Conversation

alanhamlett
Copy link
Contributor

Request loader callback was renamed in Flask-Login 0.5.0 to conform with other user/header loader names. Fixes #856.

@@ -63,7 +63,7 @@ def _get_unauthorized_view():


def _check_token():
user = _security.login_manager.request_callback(request)
user = _security.login_manager.request_loader(request)
Copy link

Choose a reason for hiding this comment

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

request_loader should return User object but it returns LocalProxy. Because of that, while executing the next line it gives the error that below error.

AttributeError: 'Request' object has no attribute 'is_authenticated'

If you replace request_loader with _request_callback it gives proper output. But it's a wrong way because it is a static method.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually - they made it python 'local' - and is called _request_callback now. I have requested that they restore that to public - which they did by providing some accessor properties. That is merged but not released.

Copy link

Choose a reason for hiding this comment

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

Actually - they made it python 'local' - and is called _request_callback now. I have requested that they restore that to public - which they did by providing some accessor properties. That is merged but not released.

Any ETA for release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Flask-Login dependency
3 participants