Example #1
0
 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")
Example #2
0
 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"))
Example #3
0
def logout():
    """Log the user out."""
    log.info('%s is logging out' % session['username'])
    return auth.logout()