thingco / shared-frontend-libs

0 stars 0 forks source link

[FEAT] - Expose errors from Auth methods #57

Closed ThingCoDanW closed 3 years ago

ThingCoDanW commented 3 years ago

Which package is this related to?

Specify the package, or if it is a new package suggest a name.

If this covers multiple packages, if possible open an issue for both and PR separately: this will keep the PR's scope as small as possible (plus each package needs separate version bumps & republishing after the fix has been applied).

Is your feature request related to a problem? Please describe. Certain methods which require validation (submit pin, submit otp) have a chance of failing/erroring. We need to handle this in the app, but currently there is no way to even know if the method has run if the stage does not change.

Describe the solution you'd like Expose errors on the current state. Either by having a currentError type export (which clears when stage changes), or returning a promise so that we can .catch() errors on the method

Describe alternatives you've considered Have tried listening for state changes so that app can make assumptions, but nothing useful is exposed

Additional context Auth context currently gets stuck on pin entry if incorrect pin is entered - entering correct pin following this does nothing (Bug?)