def clean(): """ Remove expired tokens and authorization codes. """ from canaille.ldap_backend.backend import ( setup_backend, teardown_backend, ) setup_backend(current_app) for t in Token.filter(): if t.is_expired(): t.delete() for a in AuthorizationCode.filter(): if a.is_expired(): a.delete() teardown_backend(current_app)
def index(user): tokens = Token.filter() return render_template("oidc/admin/token_list.html", tokens=tokens, menuitem="admin")