okta / okta-react-native

OIDC enablement for React Native applications
https://github.com/okta/okta-react-native
Other
58 stars 39 forks source link

Unable to get status code #324

Open Rakee08 opened 2 years ago

Rakee08 commented 2 years ago

Describe the bug?

When

authClient .signIn({ username, password }) .then((success) => { return success }) .catch((error) => { console.log(error) });

What is expected to happen?

Should return http status on the error object

What is the actual behavior?

Actual behavior - Receiving status on error.xhr.status

{ "name": "AuthApiError", "errorSummary": "Authentication failed", "errorCode": "E0000004", "errorLink": "E0000004", "errorId": "", "errorCauses": [], "xhr": { "responseText": "{\"errorCode\":\"E0000004\",\"errorSummary\":\"Authentication failed\",\"errorLink\":\"E0000004\",\"errorId\":\"\",\"errorCauses\":[]}", "status": 401, "responseType": "json", "responseJSON": { "errorCode": "E0000004", "errorSummary": "Authentication failed", "errorLink": "E0000004", "errorId": "", "errorCauses": [] } } }

Reproduction Steps?

Provide wrong username or password

Additional Information?

No response

SDK Version

"@okta/okta-react-native": "1.12.1"

Build Information

No response

evenSosaAkido commented 1 year ago

@Rakee08 did you ever solve this?

Rakee08 commented 1 year ago

@evenSosaAkido No. I have handled by showing more generalised error message.