react-oidc-context icon indicating copy to clipboard operation
react-oidc-context copied to clipboard

doc(readme): add auth.error check to auto sign in

Open jnschbrt opened this issue 1 year ago • 1 comments

  • add auth.error to auto login to prevent infinite loop when request fails

I had this problem when I got a CORS error. Therefore an endless loop was triggered during auto login

Checklist

  • [ ] This PR makes changes to the public API
  • [ ] I have included links for closing relevant issue numbers

jnschbrt avatar Jan 16 '24 09:01 jnschbrt

Thanks for reporting back and improving the docs.

I thought hasTriedSignin would take care of endless loops, maybe we just need to flip the sequence?

  auth.signinRedirect();
  setHasTriedSignin(true);

->
  setHasTriedSignin(true);
  auth.signinRedirect();

pamapa avatar Jan 16 '24 09:01 pamapa