Esempio n. 1
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"))
Esempio n. 2
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")