fix: ADMIN puede ver tickets de cualquier tenant, fixes seguridad tickets.py, logout interno
This commit is contained in:
@@ -54,13 +54,13 @@ function createAuthStore() {
|
||||
try {
|
||||
const response = await fetch('/api/v1/auth/me', {
|
||||
credentials: 'include',
|
||||
headers: { 'X-App': 'client' }
|
||||
headers: { 'X-App': 'internal' }
|
||||
});
|
||||
if (response.ok) {
|
||||
const user = await response.json();
|
||||
set({ user, token: null, isAuthenticated: true, isLoading: false });
|
||||
}
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
}
|
||||
},
|
||||
login: async (credentials: LoginRequest): Promise<void> => {
|
||||
@@ -94,12 +94,12 @@ function createAuthStore() {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'X-App': 'client',
|
||||
'X-App': 'internal',
|
||||
'X-Tenant-Slug': slug,
|
||||
...(token ? { 'Authorization': `Bearer ${token}` } : {})
|
||||
}
|
||||
});
|
||||
} catch {}
|
||||
} catch { }
|
||||
set(initialState);
|
||||
if (typeof window !== 'undefined') {
|
||||
window.location.href = '/login';
|
||||
|
||||
Reference in New Issue
Block a user