Skip to content
Snippets Groups Projects
Commit af74a911 authored by Steffen Vogel's avatar Steffen Vogel :santa_tone2:
Browse files

move update_affiliation to post_auth_hook

parent 2ea555b2
No related branches found
No related tags found
No related merge requests found
......@@ -48,28 +48,8 @@ class RemoteUserLoginHandler(BaseHandler):
if len(auth_state) > 0:
await user.save_auth_state(auth_state)
self.update_affiliation(user.orm_user)
self.statsd.incr('login.request')
def update_affiliation(self, user):
affiliations = self.request.headers.get('Edupersonscopedaffiliation')
affiliations = affiliations.split(';')
for affiliation in affiliations:
match = re.search(r'(member|student|employee)@rwth-aachen.de', affiliation)
if match is not None:
affiliation_group = match.group(1)
group = orm.Group.find(self.db, name=affiliation_group)
if group is None:
continue
if user not in group.users:
group.users.append(user)
self.db.commit()
def welcome_page(self):
"""Present welcome page with login button"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment