I have followed this as closely as I can, but I am hitting a problem when I click on the ‘login’ button in the Home component.
I am getting a Javascript error on the call to Auth.login
stringify.js:4 Uncaught (in promise) TypeError: Converting circular structure to JSON
at Object.stringify ()
at stringify (stringify.js:4)
at Auth._callee6$ (Auth.js:340)
at tryCatch (runtime.js:62)
at Generator.invoke [as _invoke] (runtime.js:296)
at Generator.prototype.(:3000/anonymous function) [as next] (http://localhost:3000/static/js/bundle.js:44962:21)
at step (asyncToGenerator.js:17)
at asyncToGenerator.js:35
at new Promise ()
at new F (_export.js:36)
at Auth. (asyncToGenerator.js:14)
at Auth.login (Auth.js:364)
at HTMLUnknownElement.callCallback (react-dom.development.js:145)
at Object.invokeGuardedCallbackDev (react-dom.development.js:195)
at invokeGuardedCallback (react-dom.development.js:248)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:262)
at executeDispatch (react-dom.development.js:593)
at executeDispatchesInOrder (react-dom.development.js:615)
at executeDispatchesAndRelease (react-dom.development.js:713)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:724)
at forEachAccumulated (react-dom.development.js:694)
at runEventsInBatch (react-dom.development.js:855)
at runExtractedEventsInBatch (react-dom.development.js:864)
at handleTopLevel (react-dom.development.js:4857)
at batchedUpdates$1 (react-dom.development.js:17498)
at batchedUpdates (react-dom.development.js:2189)
at dispatchEvent (react-dom.development.js:4936)
at interactiveUpdates$1 (react-dom.development.js:17553)
at interactiveUpdates (react-dom.development.js:2208)
at dispatchInteractiveEvent (react-dom.development.js:4913)
Here’s an example from one of our blog posts. I think you need to use await on login/logout methods or you need onClick={() => this.props.auth.login()}.
Thanks for that, the arrow function fixes the issue.
I guess I was also wanting to point out that the sample code does not work ‘out of the box’ and was wondering if the sample code could be fixed to save confusion and time for future users of the site.
Do you know the best way to report a problem like this to whoever maintains the Okta site?