okta-react-native icon indicating copy to clipboard operation
okta-react-native copied to clipboard

Unable to get status code

Open Rakee08 opened this issue 2 years ago • 2 comments

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

Rakee08 avatar Aug 29 '22 10:08 Rakee08

@Rakee08 did you ever solve this?

evenSosaAkido avatar Jan 22 '23 22:01 evenSosaAkido

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

Rakee08 avatar Jan 23 '23 05:01 Rakee08