Ajuste de cadastro/gerenciamento de usuarios e seguranca de endpoints
continuous-integration/webhook Falha no deploy (rx.scoreodonto.com)
continuous-integration/webhook Falha no deploy (rx.scoreodonto.com)
This commit is contained in:
@@ -287,8 +287,25 @@
|
||||
}
|
||||
|
||||
async function loadClients() {
|
||||
const token = localStorage.getItem('auth_token') || '';
|
||||
try {
|
||||
const response = await fetch('/api/socket/status');
|
||||
const response = await fetch('/api/socket/status', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${token}`
|
||||
}
|
||||
});
|
||||
|
||||
if (response.status === 401) {
|
||||
localStorage.removeItem('auth_token');
|
||||
window.location.href = '/login';
|
||||
return;
|
||||
}
|
||||
if (response.status === 403) {
|
||||
alert('Acesso negado. Esta área é restrita a administradores.');
|
||||
window.location.href = '/';
|
||||
return;
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
// Atualizar stats
|
||||
@@ -404,6 +421,8 @@
|
||||
testBtn.disabled = true;
|
||||
testBtn.innerHTML = '<span class="loading"></span> Testando...';
|
||||
|
||||
const token = localStorage.getItem('auth_token') || '';
|
||||
|
||||
try {
|
||||
// Limpar resultados anteriores
|
||||
testResults = {};
|
||||
@@ -413,10 +432,22 @@
|
||||
const response = await fetch('/api/socket/test-connection', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${token}`
|
||||
}
|
||||
});
|
||||
|
||||
if (response.status === 401) {
|
||||
localStorage.removeItem('auth_token');
|
||||
window.location.href = '/login';
|
||||
return;
|
||||
}
|
||||
if (response.status === 403) {
|
||||
alert('Acesso negado. Esta área é restrita a administradores.');
|
||||
window.location.href = '/';
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
// Processar resultados
|
||||
|
||||
Reference in New Issue
Block a user