mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-04 17:35:39 +00:00
parent
2f39512b65
commit
9e6822bcdb
@ -301,6 +301,12 @@ def saml_authorized():
|
|||||||
|
|
||||||
@app.route('/login', methods=['GET', 'POST'])
|
@app.route('/login', methods=['GET', 'POST'])
|
||||||
@login_manager.unauthorized_handler
|
@login_manager.unauthorized_handler
|
||||||
|
def unauthorized_callback():
|
||||||
|
session['next'] = request.path
|
||||||
|
return redirect('/login')
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/login', methods=['GET', 'POST'])
|
||||||
def login():
|
def login():
|
||||||
SAML_ENABLED = app.config.get('SAML_ENABLED')
|
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')
|
return render_template('login.html', saml_enabled=SAML_ENABLED, error='Token required')
|
||||||
|
|
||||||
login_user(user, remember = remember_me)
|
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:
|
else:
|
||||||
if not username or not password or not email:
|
if not username or not password or not email:
|
||||||
return render_template('register.html', error='Please input required information')
|
return render_template('register.html', error='Please input required information')
|
||||||
|
Loading…
Reference in New Issue
Block a user