From 2fca394d5c5855a280a1b9208abd0807b8a21277 Mon Sep 17 00:00:00 2001 From: Nora Shapiro Date: Fri, 27 Sep 2024 12:27:07 -0700 Subject: [PATCH] update okta cloud views (#841) --- codecov_auth/views/okta_cloud.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codecov_auth/views/okta_cloud.py b/codecov_auth/views/okta_cloud.py index a243f33a51..d9268b3833 100644 --- a/codecov_auth/views/okta_cloud.py +++ b/codecov_auth/views/okta_cloud.py @@ -50,7 +50,7 @@ def get( self, request: HttpRequest, service: str, org_username: str ) -> HttpResponse: log_context: dict = {"service": service, "username": org_username} - if not request.session.get("current_owner_id"): + if not request.user or request.user.is_anonymous: log.warning( "User needs to be signed in before authenticating organization with Okta.", extra=log_context, @@ -114,7 +114,7 @@ def get(self, request: HttpRequest) -> HttpResponse: "username": org_owner.username, } - if not request.session.get("current_owner_id"): + if not request.user or request.user.is_anonymous: log.warning( "User not logged in for Okta callback.", extra=log_context,