feat(auth/contact/sms): sync contact submissions in admin, refine SMS error logs, trigger Auth Modal on 401 [TASK-13.1, TASK-14.1, TASK-15.1]
This commit is contained in:
1 parent
89c836d7b6
commit
d52d1e57f2
4 files changed
+34
-33
No files matched your search
@@ -46,8 +46,17 @@ api.interceptors.response.use(
|
||||
const status = error.response?.status;
|
||||
const farsiMessage = responseData?.message || 'خطایی در ارتباط با سرور رخ داده است.';
|
||||
|
||||
// Handle 401 Unauthorized globally
|
||||
if (status === 401 || status === 403) {
|
||||
// Handle 401 Unauthorized globally - trigger Auth Modal
|
||||
if (status === 401) {
|
||||
localStorage.removeItem('accessToken');
|
||||
localStorage.removeItem('refreshToken');
|
||||
try {
|
||||
useUserStore.getState().logout();
|
||||
useUserStore.getState().setAuthModalOpen(true);
|
||||
} catch {
|
||||
// Ignore if store not ready
|
||||
}
|
||||
} else if (status === 403) {
|
||||
localStorage.removeItem('accessToken');
|
||||
localStorage.removeItem('refreshToken');
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user