Esempio n. 1
0
def logout():
    if logged_in():
        flash('You have been logged out.')
        auth.logout()
    else:
        flash('You are not logged in!')
    return redirect(url_for('index'))
Esempio n. 2
0
def logout():
    if auth.logged_in():
        auth.logout()
        flash('You have been logged out.')
    else:
        flash('Logout Error: You are not logged in.')
    return redirect('index')
Esempio n. 3
0
def logout():
    # Delete session cookie etc.
    if auth.logged_in(g_username):
        auth.logout(g_username)
        global g_username
        g_username = ""
        app.jinja_env.globals.update(g_username="")
        session['alert-type'] = 'notice'
        flash('You have been logged out.')
    else:
        session['alert-type'] = 'error'
        flash('You can\'t log out if you aren\'t logged in.')
    return redirect(url_for('index'))
Esempio n. 4
0
def logout():
    auth.logout()
    return redirect( url_for("root") )
Esempio n. 5
0
 def get(self):
     logout()
     return redirect(url_for('user.login'))