Hey guys so I am encountering a unauthorised error...
# talk-oathkeeper
b
Hey guys so I am encountering a unauthorised error in oathkeeper. In my application when I logout and again try to hit the protected URL, for the first time it throws
Access Credentials are Invalid
error and then does not redirect to the login page even when I have a handler for unauthorised error. But when I reload the page again it throws the same error but this time it redirects to the login page. These are my oathkeeper rules.
Copy code
handlers:
    redirect:
      enabled: true
      config:
        to: <http://127.0.0.1:4455/.factly/kavach/web/auth/login>
        when:
          -
            error:
              - unauthorized
              - forbidden
            request:
              header:
                accept:
                  - text/html
    json:
      enabled: true
      config:
        verbose: true