Skip to content

Commit

Permalink
Merge pull request #49 from heviat/oidc
Browse files Browse the repository at this point in the history
Fix #39
  • Loading branch information
Encotric authored Jan 24, 2025
2 parents 27a866b + 11b3e2f commit 94f2658
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/admin/mailu/sso/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ def login():

fields = []

if 'url' in flask.request.args and not 'homepage' in flask.request.url:
fields.append(form.submitAdmin)
else:
form.submitAdmin.label.text = form.submitAdmin.label.text + ' Admin'
form.submitWebmail.label.text = form.submitWebmail.label.text + ' Webmail'
if str(app.config["WEBMAIL"]).upper() != "NONE":
fields.append(form.submitWebmail)
if str(app.config["ADMIN"]).upper() != "FALSE":
fields.append(form.submitAdmin)
fields = [fields]

# [OIDC] Add the OIDC login flow
if 'code' in flask.request.args:
username, sub, id_token, token_response = utils.oic_client.exchange_code(flask.request.query_string.decode())
Expand Down Expand Up @@ -136,7 +147,7 @@ def pw_change():
return flask.redirect(destination)
flask.flash(_("The current password is incorrect!"), "error")

return flask.render_template('pw_change.html', form=form)
return flask.render_template('pw_change.html', form=form, fields=[])

@sso.route('/logout', methods=['GET'])
@access.authenticated
Expand Down

0 comments on commit 94f2658

Please sign in to comment.