now most of logic works as it should
This commit is contained in:
+3
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user