Consolidate WebAuthenticationException
s caused by a user cancelling the flow into a single exception.
#395
Labels
WebAuthenticationException
s caused by a user cancelling the flow into a single exception.
#395
Checklist
Describe the problem you'd like to have solved
Users cancelling a web authentication session workflow results in a
WebAuthenticationException
with an internalcode
field that describes the cause for the exception. Presumably this is because many things could cause this type of exception.I have a use case where knowing specifically that the user cancelled the session is helpful, but in order to identify whether this action was taken by a user, I must inspect the code for each platform that can throw it (iOS and Android for me) and determine whether the code is either
USER_CANCELLED
(iOS) ora0.authentication_canceled
(Android). These appear to be platform-specific codes that are emitted from a native layer.Describe the ideal solution
Ideally there is an exception type that wraps any scenario where a user cancelled the web authentication session, perhaps by subclassing
WebAuthenticationException
with a new exceptionUserCancelledWebAuthenticationException
. Internal to the SDK, this exception can be created by inspecting the variety of codes that indicate the exception, and create a single exception that could be caught and dealt with.Alternatives and current workarounds
As it stands, this is the class I am using to capture these codes:
Then in my login method I am doing something like the following:
Additional context
No response
The text was updated successfully, but these errors were encountered: