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) { handleMessage(data) {
switch (data.type) { switch (data.type) {
case 'welcome': case 'welcome':
// If we have a token, we're about to authenticate - don't set guest info // Always set initial user info from welcome message
// The auth_success message will set the correct user info // If auth succeeds, auth_success will upgrade to authenticated user
if (!this.token) { // This ensures proper fallback if auth fails (e.g., expired token)
chatUserInfo.set({ chatUserInfo.set({
username: data.username, username: data.username,
userId: data.userId, userId: data.userId,
@ -114,7 +114,8 @@ class ChatWebSocket {
isSiteModerator: data.isSiteModerator || false, isSiteModerator: data.isSiteModerator || false,
isStreamer: data.isStreamer || false, isStreamer: data.isStreamer || false,
isAdmin: data.isAdmin || 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 // If guest and has saved name in localStorage, rename immediately
@ -128,7 +129,6 @@ class ChatWebSocket {
}, 100); }, 100);
} }
} }
}
break; break;
case 'history': case 'history':
@ -175,10 +175,17 @@ class ChatWebSocket {
case 'error': case 'error':
console.error('Chat error:', data.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') { 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); alert(data.error);
} }
}
break; break;
case 'mod_action_success': case 'mod_action_success':