-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Describe the bug
I've found that OktaCallbackComponent can swallow errors thrown asynchronously in the awaited this.oktaAuth.handleLoginRedirect() call.
Note the component has an async ngOnInit, but Angular expects a synchronous ngOnInit. This means that Angular does not handle any async errors during or after the first await, nor does it block anything waiting for the promise to resolve.
I found that with some async errors, the callback component's catch bock sets the error property on the component, but the component does not render the error string.
All this should be cleaned up, using ngOnInit properly, and giving users a hook into errors so they can log them to a server-side component or otherwise handle accordingly.
Reproduction Steps?
Throw an error inside a custom restoreOriginalUri, callback on the okta auth options, which is called by oktaAuth.handleLoginRedirect()
SDK Versions
"@okta/okta-angular": "6.4.0",
"@okta/okta-auth-js": "7.6.0",
Additional Information
No response