def logout():
"""Route decorator destroys flask session and redirects to auth0 to destroy
auth0 session. Ending page is mozilla signout.html."""
logger.info("User called logout route.")
if os.environ.get('ENVIRONMENT') == 'Production':
proto = "https"
else:
proto = "http"
return_url = "{proto}://{server_name}/signout.html".format(
proto=proto, server_name=app.config['SERVER_NAME']
)
logout_url = "https://{auth0_domain}/v2/logout?returnTo={return_url}".format(
auth0_domain=oidc_config.OIDC_DOMAIN, return_url=return_url
)
return redirect(logout_url, code=302)
评论列表
文章目录