Add Clear link to clear cookies on expired token error message

pull/2842/head
Rick Fryar 10 months ago committed by GitHub
parent f2369609e8
commit f802d99452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -50,6 +50,7 @@
</a>
{% endif %}
{% endif %}
<br/><button name="clearToken" type="button" class="btn btn-default" onclick="window.location.href='/clear'">Clear Tokens</button>
</form>
</div>
{% if error %}

@ -36,6 +36,7 @@ from sqlalchemy.exc import IntegrityError, InvalidRequestError, OperationalError
from sqlalchemy.sql.expression import text, func, false, not_, and_, or_
from sqlalchemy.orm.attributes import flag_modified
from sqlalchemy.sql.functions import coalesce
from urllib.parse import urlparse
from werkzeug.datastructures import Headers
from werkzeug.security import generate_password_hash, check_password_hash
@ -1414,6 +1415,14 @@ def logout():
log.debug("User logged out")
return redirect(url_for('web.login'))
@web.route('/clear')
def clear():
o = urlparse(request.base_url)
host = o.hostname
response = make_response(redirect('/login'))
response.set_cookie('session', '', expires=0, httponly=True, domain=host)
response.set_cookie('remember_token', '', expires=0, httponly=True,domain=host)
return response
# ################################### Users own configuration #########################################################
def change_profile(kobo_support, local_oauth_check, oauth_status, translations, languages):

Loading…
Cancel
Save