rental request email to owner
This commit is contained in:
@@ -58,13 +58,9 @@ api.interceptors.request.use(async (config) => {
|
||||
if (["POST", "PUT", "DELETE", "PATCH"].includes(method)) {
|
||||
// If we don't have a CSRF token yet, try to fetch it
|
||||
if (!csrfToken) {
|
||||
// Skip fetching for most auth endpoints to avoid circular dependency
|
||||
// Exception: /auth/google needs CSRF token and should auto-fetch as fallback
|
||||
const isAuthEndpoint =
|
||||
config.url?.includes("/auth/") &&
|
||||
!config.url?.includes("/auth/refresh") &&
|
||||
!config.url?.includes("/auth/google");
|
||||
if (!isAuthEndpoint) {
|
||||
// Skip fetching only for the CSRF token endpoint itself to avoid circular dependency
|
||||
const isCsrfEndpoint = config.url?.includes("/auth/csrf-token");
|
||||
if (!isCsrfEndpoint) {
|
||||
await fetchCSRFToken();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user