Skip to content

Commit

Permalink
Let email to be purely email address
Browse files Browse the repository at this point in the history
  • Loading branch information
ntai-arxiv committed Oct 15, 2024
1 parent 845e93f commit 2ce2ca9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions legacy_auth_provider/src/legacy_auth_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,16 @@ def tapir_user_to_auth_response(tapir_user: TapirUser) -> AuthResponse:

attributes = {}

# not used
# Important to have this. Otherwise, Keycloak does not pick up the email
attributes["email"] = [tapir_user.email]

# not used
email_preferences = "email_preferences"
attributes[email_preferences] = []
if tapir_user.flag_wants_email:
attributes["email"].append('WantsEmail')
attributes[email_preferences].append('WantsEmail')
if tapir_user.flag_html_email:
attributes["email"].append('HtmlEmail')
attributes[email_preferences].append('HtmlEmail')

# not used
attributes["share"] = []
Expand Down

0 comments on commit 2ce2ca9

Please sign in to comment.