okta/okta-react-native

Unable to get status code

Rakee08 opened this issue · 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 did you ever solve this?

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