Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nilupulmanodya committed Oct 14, 2023
1 parent 34e7e33 commit b02854a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions mslib/mscolab/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def acs_post_handler(url):
)
email = None
username = None
token = None

try:
email = authn_response.ava["email"][0]
username = authn_response.ava["givenName"][0]
Expand All @@ -842,13 +842,9 @@ def acs_post_handler(url):
attributes[attribute_name] = attribute_value

# Extract the email and givenname attributes
email = attributes.get("email")
username = attributes.get("givenName")

if email is not None and username is not None:
token = generate_confirmation_token(email)
else:
render_template('errors/403.html'), 403
email = attributes["email"]
username = attributes["givenName"]
token = generate_confirmation_token(email)

except (NameError, AttributeError, KeyError):
render_template('errors/403.html'), 403
Expand Down

0 comments on commit b02854a

Please sign in to comment.