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>
|
||||
{% else %}
|
||||
<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 %}
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -66,8 +66,9 @@ class LogoutView(View):
|
|||
def dispatch_request(self):
|
||||
session_vars = ['token_dlt', 'rols']
|
||||
[session.pop(i, '') for i in session_vars]
|
||||
next_url = flask.request.args.get('next')
|
||||
logout_user()
|
||||
return flask.redirect(flask.url_for('core.login'))
|
||||
return flask.redirect(next_url or flask.url_for('core.login'))
|
||||
|
||||
|
||||
class GenericMixin(View):
|
||||
|
|
Reference in New Issue