这是indexloc提供的服务,不要输入任何密码
Skip to content

renewTokens() fails silently without throwing an error #1236

@abhilashlr7

Description

@abhilashlr7

Issue and Steps to Reproduce

When we perform an API call, we use the accessToken and send it to our API endpoint. If the response status is a 401, we refetch the latest accessToken by using the renewTokens() method. Since this method is a promise, we do wait for it and then reperform the API that initially returned a 401.

Now this method seems to eat the error when there is a peculiar scenario where we have the accessTokenPaylod like the following:

"accessTokenPayload": {
      "exp": 1701898951,
      "iat": 1701895411,
      ...
}

Apparently, the exp and iat are well before current UNIX timestamp. Therefore what happens is, the method fails (I suppose - not 100% sure). Because of it, we are unable to get the token for re-firing the API.

Versions

7.12.2

Screenshots

Expected

The method should return the valid accessToken instead of failing silently.

Actual

The method fails silently

Additional Details

  • Installed packages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions