Skip to content

OktaCallbackComponent swallows errors #155

@matthewjh

Description

@matthewjh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions