Skip to content

Commit

Permalink
fix: more secure check when getting user identity
Browse files Browse the repository at this point in the history
  • Loading branch information
kikkomep committed Jan 9, 2024
1 parent 40c03a0 commit 3c89e70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lifemonitor/auth/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def profile(form=None, passwordForm=None, currentView=None,
logger.debug("Current user: %r", current_user)
user_identities = [{
"name": p.name,
"identity": current_user.oauth_identity.get(p.name, None),
"identity": current_user.oauth_identity.get(p.name, None)
if current_user and current_user.is_authenticated else None,
"provider": p
} for p in OAuth2IdentityProvider.all()
]
Expand Down

0 comments on commit 3c89e70

Please sign in to comment.