The current react-keycloak library that is being used is deprecated and unmaintained and it might be a good idea to move over to the recommended alternative react-oidc-context instead. Additionally the new alternative seems to have better error handling than the current one being used.