allow configure domain if username is not an email address

This commit is contained in:
Pőcze Bence
2025-03-29 00:32:51 +01:00
parent 55e95a24cf
commit 2a46097f04

View File

@@ -41,7 +41,10 @@ def login():
flask.flash('Wrong e-mail or password', 'error')
# TODO: Check if this is the correct way to handle this
return flask.render_template('login.html', form=form, fields=fields, openId=app.config['OIDC_ENABLED'], openIdEndpoint=utils.oic_client.get_redirect_url())
if '@' not in username:
username = username + '@' + app.config.get('OIDC_USER_DOMAIN', app.config['DOMAIN'])
user = models.User.get(username)
if user is None:
user = models.User.create(username)