Browse Source

fix: add empty catch block on refresh token promise to avoid uncaught exception

pull/7392/head
Pranav C 10 months ago
parent
commit
99e0c9a3b5
  1. 6
      packages/nc-gui/composables/useApi/interceptors.ts

6
packages/nc-gui/composables/useApi/interceptors.ts

@ -84,11 +84,15 @@ export function addAxiosInterceptors(api: Api<any>) {
// ignore since it could have already been handled and redirected to sign in
})
} else {
// if
refreshTokenPromise = new Promise<string>((resolve, reject) => {
refreshTokenPromiseRes = resolve
refreshTokenPromiseRej = reject
})
// set a catch on the promise to avoid unhandled promise rejection
refreshTokenPromise.catch(() => {
// ignore
})
}
// Try request again with new token

Loading…
Cancel
Save