from quart import Blueprint, render_template, request, redirect, url_for, flash from flask_login import logout_user bp = Blueprint('meta', 'meta') @bp.route('/') async def index(): return await render_template('index.html') @bp.route('/logout') async def logout(): """ Log the current user out and redirect someplace within app if needed. If 'next' is in the request args and is valid route, redirect there, otherwise, redirect to peel off args and go home. """ logout_user() return redirect(url_for('meta.index'))