Skip to content

Commit

Permalink
update okta cloud views (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
nora-codecov authored Sep 27, 2024
1 parent aa0e363 commit 2fca394
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codecov_auth/views/okta_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2fca394

Please sign in to comment.