mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 23:20:27 +00:00
parent
2f39512b65
commit
9e6822bcdb
@ -301,6 +301,12 @@ def saml_authorized():
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
@login_manager.unauthorized_handler
|
||||
def unauthorized_callback():
|
||||
session['next'] = request.path
|
||||
return redirect('/login')
|
||||
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login():
|
||||
SAML_ENABLED = app.config.get('SAML_ENABLED')
|
||||
|
||||
@ -425,7 +431,7 @@ def login():
|
||||
return render_template('login.html', saml_enabled=SAML_ENABLED, error='Token required')
|
||||
|
||||
login_user(user, remember = remember_me)
|
||||
return redirect(request.args.get('next') or url_for('index'))
|
||||
return redirect(session.get('next', url_for('index')))
|
||||
else:
|
||||
if not username or not password or not email:
|
||||
return render_template('register.html', error='Please input required information')
|
||||
|
Loading…
Reference in New Issue
Block a user