Skip to content

/userinfo response is broken with status 401 #1375

Description

@alessioemireni

Checklist

Description

Hi team,
we are encountering an issue with the /userInfo API with the latest v5.0.1.
When the token is expired the status code 401 is correct but the response is broken and this causes a general NetworkError. This error blocks the process to refresh the token because the 'invalid grant' is not returned from the API body.

Could you please give a check?

Below some examples of the error taken from Reactotron:
Broken /userinfo API response

Image

And the console.log error:

Image

This is the point in your library where the exception is thrown:

Image

Reproduction

  1. invoke auth0.auth.userInfo({token}) when the token is expired
  2. the API returns a status code 401
  3. when the response is parsed it throws a NetworkError and not an 'invalid_token' message

Additional context

No response

react-native-auth0 version

v5.0.1

React Native version

0.81.5

Expo version

No response

Platform

Android

Platform version(s)

16

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions