def wrapped(*args, **kwargs): if auth.is_valid_session(): try: session["last_check"] = dtime.now() return anyfunc(*args, **kwargs) except KeyError as err: pass # bad session if we fell through auth.logout() raise errors.InvalidSessionError("not logged in")
def wrapped(*args, **kwargs): try: if auth.is_valid_session(): return anyfunc(*args, **kwargs) except errors.InvalidSessionError as err: pass # bad session if we fell through auth.logout() flash("Login session is not valid or has expired") return redirect(url_for("login"))
def logout(): """Log the user out.""" log.info('%s is logging out' % session['username']) return auth.logout()