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): authorizations = AuthorizationCode.filter() return render_template( "oidc/admin/authorization_list.html", authorizations=authorizations )