def fresh_login_required(func):
 @wraps(func)
 def decorated_view(*args, **kwargs):
  if (request.method in EXEMPT_METHODS):
   return func(*args, **kwargs)
  elif current_app.login_manager._login_disabled:
   return func(*args, **kwargs)
  elif (not current_user.is_authenticated):
   return current_app.login_manager.unauthorized()
  elif (not login_fresh()):
   return current_app.login_manager.needs_refresh()
  return func(*args, **kwargs)
 return decorated_view

def fresh_login_required ( func ) : @ wraps ( func ) def decorated_view ( * args , ** kwargs ) : if ( request . method in EXEMPT_METHODS ) : return func ( * args , ** kwargs ) elif current_app . login_manager . _login_disabled : return func ( * args , ** kwargs ) elif ( not current_user . is_authenticated ) : return current_app . login_manager . unauthorized ( ) elif ( not login_fresh ( ) ) : return current_app . login_manager . needs_refresh ( ) return func ( * args , ** kwargs ) return decorated_view
if you decorate a view with this .