Hi guys Igot this code to login, the problem is that there is no way to know the reason why failed, I need to show info to the UI or know what type of issue I’m facing. Doc doesn’t say anything about errors.
Error: Request failed (POST https://stitch.mongodb.com/api/client/v2.0/app/xxxx/auth/providers/local-userpass/login): invalid username/password (status 401)
at Function.fromRequestAndResponse (bundle.dom.es.js:2696)
at async Fetcher.fetch (bundle.dom.es.js:2864)
at async Fetcher.fetchJSON (bundle.dom.es.js:2881)
at async Authenticator.authenticate (bundle.dom.es.js:2592)
at async App.logIn (bundle.dom.es.js:3073)
at async handleSignIn (SignIn.js:37)
Programmatically I’m expecting an object with error_code Luke I see on the network http payload but I’m not able to retrieve it on realm-web and act to different situations like wrong password/username or email confirmation pending for example.
@Juan_Jose_N_A This could definitely use improvement. In the web tutorial we parse the info out using a regex but we realize this shouldn’t be necessary. Instead we could throw a custom RealmAuthError that includes the error code and message as separate properties. We have added this to backlog and hope to get to it in the next quarter