Store next url redirect for in session to work with oauth login callbacks
This commit is contained in:
parent
0b931d1a05
commit
aa0a8a2aa8
4 changed files with 8 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for
|
||||
from flask import current_app, render_template, request, redirect, Blueprint, flash, url_for, session
|
||||
from realms.modules.auth.local.models import User
|
||||
from realms.modules.auth.local.forms import LoginForm, RegistrationForm
|
||||
|
||||
|
@ -46,6 +46,6 @@ def register():
|
|||
User.create(request.form['username'], request.form['email'], request.form['password'])
|
||||
User.auth(request.form['email'], request.form['password'])
|
||||
|
||||
return redirect(request.args.get("next") or url_for(current_app.config['ROOT_ENDPOINT']))
|
||||
return redirect(session.get("next_url") or url_for(current_app.config['ROOT_ENDPOINT']))
|
||||
|
||||
return render_template("auth/register.html", form=form)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue