@volr/react 0.1.45 → 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.cjs CHANGED
@@ -9090,10 +9090,25 @@ var APIClient = class {
9090
9090
  (response) => response,
9091
9091
  async (error) => {
9092
9092
  const originalRequest = error.config;
9093
- if (originalRequest?.url?.includes("/auth/refresh")) {
9093
+ const requestUrl = originalRequest?.url || "";
9094
+ const publicAuthEndpoints = [
9095
+ "/auth/refresh",
9096
+ "/auth/siwe/nonce",
9097
+ "/auth/siwe/verify",
9098
+ "/auth/email/send-code",
9099
+ "/auth/email/verify-code",
9100
+ "/auth/social/"
9101
+ ];
9102
+ const isPublicAuthEndpoint = publicAuthEndpoints.some(
9103
+ (endpoint) => requestUrl.includes(endpoint)
9104
+ );
9105
+ if (isPublicAuthEndpoint) {
9094
9106
  return Promise.reject(error);
9095
9107
  }
9096
9108
  if (error.response?.status === 401 && !originalRequest._retry) {
9109
+ if (!this.refreshToken) {
9110
+ return Promise.reject(error);
9111
+ }
9097
9112
  originalRequest._retry = true;
9098
9113
  try {
9099
9114
  await this.refreshAccessToken();