now most of logic works as it should

This commit is contained in:
GitProtogen
2026-03-07 20:34:10 +01:00
parent ced7937583
commit aebe0c7549
4 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -82,13 +82,13 @@ $html->content = <<<'HTML'
ws.onmessage = (event) => {
const text = event.data;
if (text === 'authenticated') {
if (text === '{"success"}: "authenticated"') {
log('Authenticated.', 'system');
setAuthenticated(true);
} else if (text === 'invalid token') {
} else if (text === '{"error"}: "invalid token"') {
log('Invalid token. Connection closed.', 'error');
ws.close();
} else if (text === 'not authenticated') {
} else if (text === '{"error"}: "you are not authenticated"') {
log('Server: not authenticated', 'error');
} else {
try {