@volr/react 0.1.44 → 0.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9066,10 +9066,25 @@ var APIClient = class {
9066
9066
  (response) => response,
9067
9067
  async (error) => {
9068
9068
  const originalRequest = error.config;
9069
- if (originalRequest?.url?.includes("/auth/refresh")) {
9069
+ const requestUrl = originalRequest?.url || "";
9070
+ const publicAuthEndpoints = [
9071
+ "/auth/refresh",
9072
+ "/auth/siwe/nonce",
9073
+ "/auth/siwe/verify",
9074
+ "/auth/email/send-code",
9075
+ "/auth/email/verify-code",
9076
+ "/auth/social/"
9077
+ ];
9078
+ const isPublicAuthEndpoint = publicAuthEndpoints.some(
9079
+ (endpoint) => requestUrl.includes(endpoint)
9080
+ );
9081
+ if (isPublicAuthEndpoint) {
9070
9082
  return Promise.reject(error);
9071
9083
  }
9072
9084
  if (error.response?.status === 401 && !originalRequest._retry) {
9085
+ if (!this.refreshToken) {
9086
+ return Promise.reject(error);
9087
+ }
9073
9088
  originalRequest._retry = true;
9074
9089
  try {
9075
9090
  await this.refreshAccessToken();