Update user with info from oidc during login

This commit is contained in:
Nick Douma 2020-03-06 13:49:22 +01:00
parent 4e63f8380b
commit ab6480a4b4

View File

@ -297,11 +297,17 @@ def login():
firstname=oidc_givenname, firstname=oidc_givenname,
lastname=oidc_familyname, lastname=oidc_familyname,
email=oidc_email) email=oidc_email)
result = user.create_local_user() result = user.create_local_user()
if not result['status']: else:
session.pop('oidc_token', None) user.firstname = oidc_givenname
return redirect(url_for('index.login')) user.lastname = oidc_familyname
user.email = oidc_email
user.plain_text_password = None
result = user.update_local_user()
if not result['status']:
session.pop('oidc_token', None)
return redirect(url_for('index.login'))
session['user_id'] = user.id session['user_id'] = user.id
session['authentication_type'] = 'OAuth' session['authentication_type'] = 'OAuth'