def salt_auth_tool():
    '''
    Redirect all unauthenticated requests to the login page
    '''
    # Redirect to the login page if the session hasn't been authed
    if 'token' not in cherrypy.session:  # pylint: disable=W8601
        raise cherrypy.HTTPError(401)

    # Session is authenticated; inform caches
    cherrypy.response.headers['Cache-Control'] = 'private'
dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_cherrypy/app.py/salt_auth_tool/original