Skip to content

Commit

Permalink
Use preferred_username as login_hint
Browse files Browse the repository at this point in the history
  • Loading branch information
MWedl committed Jan 15, 2025
1 parent 15902b5 commit 0de34dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/reportcreator_api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def login_oidc_complete(self, request, oidc_provider, *args, **kwargs):
can_reauth = (timezone.now() - timezone.make_aware(datetime.fromtimestamp(auth_time))) < timedelta(minutes=1)
res = self.perform_login(request, identity.user, can_reauth=can_reauth)
request.session['authentication_info'] |= {
f'oidc_{oidc_provider}_login_hint': token['userinfo'].get('login_hint'),
f'oidc_{oidc_provider}_login_hint': token['userinfo'].get('preferred_username') or token['userinfo'].get('login_hint'),
}
return res

Expand Down

0 comments on commit 0de34dc

Please sign in to comment.