Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

LoginCallback triggers React error on failure: Objects are not valid as a React child #699

Closed
2 of 9 tasks
bcbee opened this issue Mar 13, 2020 · 6 comments
Closed
2 of 9 tasks

Comments

@bcbee
Copy link

bcbee commented Mar 13, 2020

I'm submitting this issue for the package(s):

  • jwt-verifier
  • okta-angular
  • oidc-middleware
  • okta-react
  • okta-react-native
  • okta-vue

I'm submitting a:

  • Bug report
  • Feature request
  • Other (Describe below)

Current behavior

If the LoginCallback component encounters an error during authorization it improperly attempts to add an object to the React DOM triggering an exception.

Expected behavior

Errors should be gracefully added to the DOM or console without exception.

Minimal reproduction of the problem with instructions

  1. Download https://github.com/okta/samples-js-react/tree/master/okta-hosted-login
  2. Add testing ISSUER and CLIENT_ID environment variables
  3. Run npm i and npm start
  4. Navigate to http://localhost:8080/implicit/callback#id_token=123 (invalid token)
  5. Open JS console and observe React internals error triggered within LoginCallback component

Extra information about the use case/user story you are trying to implement

Console output:

LoginCallbackBug-ConsoleOutput.log

Error message:

Error: Objects are not valid as a React child (found: object with keys {name, message, errorCode, errorSummary, errorLink, errorId, errorCauses}). If you meant to render a collection of children, use an array instead.
...
The above error occurred in the <p> component:

Environment

  • Package Version: okta-react 2.0.0
  • Browser: Google Chrome 80.0.3987.132 (latest)
  • OS: macOS Catalina 10.15.3
  • Node version (node -v): v10.19.0
  • Other:
@bcbee bcbee changed the title LoginCallback triggers React error on failed redirect LoginCallback triggers React error on failure: Objects are not valid as a React child Mar 13, 2020
@swiftone
Copy link
Contributor

Internal ref: OKTA-282543

@rodrigowpl
Copy link

rodrigowpl commented Mar 14, 2020

Same issue here, any update?

@daveed80
Copy link

@swiftone @rodrigowpl

+1.... have you heard of any updates on this?

@swiftone
Copy link
Contributor

We have a PR in the works: #700

@brettritter-okta
Copy link
Contributor

After a mild fight with our CI system, @okta/okta-react 2.0.1 has been released with this fix. Thanks for your patience.

@daveed80
Copy link

daveed80 commented Mar 20, 2020

@brettritter-okta

Thanks much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants