redirect in logout
This commit is contained in:
parent
46860660e0
commit
7990f4518b
|
@ -53,7 +53,7 @@
|
||||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#validateModal">Validate</button>
|
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#validateModal">Validate</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button class="btn btn-primary" id="buttonRol" data-bs-toggle="modal" data-bs-target="#rolsModal">Select your rol</button>
|
<button class="btn btn-primary" id="buttonRol" data-bs-toggle="modal" data-bs-target="#rolsModal">Select your rol</button>
|
||||||
<a class="btn btn-primary" href="{{ url_for('core.logout') }}">Logout</a>
|
<a class="btn btn-primary" href="{{ url_for('core.logout') }}?next={{ device_real.url.to_text() }}">Logout</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -66,8 +66,9 @@ class LogoutView(View):
|
||||||
def dispatch_request(self):
|
def dispatch_request(self):
|
||||||
session_vars = ['token_dlt', 'rols']
|
session_vars = ['token_dlt', 'rols']
|
||||||
[session.pop(i, '') for i in session_vars]
|
[session.pop(i, '') for i in session_vars]
|
||||||
|
next_url = flask.request.args.get('next')
|
||||||
logout_user()
|
logout_user()
|
||||||
return flask.redirect(flask.url_for('core.login'))
|
return flask.redirect(next_url or flask.url_for('core.login'))
|
||||||
|
|
||||||
|
|
||||||
class GenericMixin(View):
|
class GenericMixin(View):
|
||||||
|
|
Reference in New Issue