Skip to content

How can I send request again in response interceptor? #1486

@nuykon

Description

@nuykon
const responseInterceptor = (res) => {
  if (res.status === 401) {
    if (res.body.message.includes('jwt invalid')) {
      updateToken().then(() => {
        // send current request again
      });
    } else {
      window.location.href = '/auth';
    }
  }
  return res;
};

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions