Add automatic SSL certificate generation
All checks were successful
Build and Push / build-all (push) Successful in 1m36s

This commit is contained in:
doomtube 2026-01-06 17:33:07 -05:00
parent 42855330c0
commit c20a5e7486

View file

@ -103,9 +103,9 @@ class ChatWebSocket {
handleMessage(data) {
switch (data.type) {
case 'welcome':
// If we have a token, we're about to authenticate - don't set guest info
// The auth_success message will set the correct user info
if (!this.token) {
// Always set initial user info from welcome message
// If auth succeeds, auth_success will upgrade to authenticated user
// This ensures proper fallback if auth fails (e.g., expired token)
chatUserInfo.set({
username: data.username,
userId: data.userId,
@ -114,7 +114,8 @@ class ChatWebSocket {
isSiteModerator: data.isSiteModerator || false,
isStreamer: data.isStreamer || false,
isAdmin: data.isAdmin || false,
avatarUrl: data.avatarUrl || ''
avatarUrl: data.avatarUrl || '',
userColor: data.userColor || '#888888'
});
// If guest and has saved name in localStorage, rename immediately
@ -128,7 +129,6 @@ class ChatWebSocket {
}, 100);
}
}
}
break;
case 'history':
@ -175,10 +175,17 @@ class ChatWebSocket {
case 'error':
console.error('Chat error:', data.error);
// Show error to user
// Show error to user for actionable errors (not auth errors which are handled separately)
if (data.error && typeof window !== 'undefined') {
const errorMsg = data.error.toLowerCase();
// Don't alert for auth/token errors - user should re-login
const isAuthError = errorMsg.includes('token') ||
errorMsg.includes('unauthorized') ||
errorMsg.includes('auth');
if (!isAuthError) {
alert(data.error);
}
}
break;
case 'mod_action_success':