@classmethod
def is_token_authenticated(cls, handler):
    """Returns True if handler has been token authenticated. Otherwise, False.

        Login with a token is used to signal certain things, such as:

        - permit access to REST API
        - xsrf protection
        - skip origin-checks for scripts
        """
    if getattr(handler, '_user_id', None) is None:
        handler.get_current_user()
    return getattr(handler, '_token_authenticated', False)
