Skip to content
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

Fix Flask Login user setting for Flask 2.2 and Flask-Login 0.6.2 #25318

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions airflow/providers/google/common/auth_backend/google_openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import google
import google.auth.transport.requests
import google.oauth2.id_token
from flask import Response, _request_ctx_stack, current_app, request as flask_request # type: ignore
from flask import Response, current_app, request as flask_request # type: ignore
from google.auth import exceptions
from google.auth.transport.requests import AuthorizedSession
from google.oauth2 import service_account
Expand Down Expand Up @@ -101,8 +101,7 @@ def _lookup_user(user_email: str):


def _set_current_user(user):
ctx = _request_ctx_stack.top
ctx.user = user
current_app.appbuilder.sm.lm._update_request_context_with_user(user=user) # type: ignore[attr-defined]


T = TypeVar("T", bound=Callable)
Expand Down