Fix session resume and auth helper fallbacks
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
{
|
||||
"sections": [
|
||||
{
|
||||
"date": "March 8, 2026",
|
||||
"items": [
|
||||
"Added a command palette with Shift+K, Shift+F10, or the Applications key to show all available commands."
|
||||
]
|
||||
},
|
||||
{
|
||||
"date": "February 28, 2026",
|
||||
"items": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Maintainer-controlled web client version metadata.
|
||||
window.CHGRID_RELEASE_VERSION = "0.1.0";
|
||||
window.CHGRID_BUILD_REVISION = "R344";
|
||||
window.CHGRID_BUILD_REVISION = "R345";
|
||||
window.CHGRID_WEB_VERSION = `${window.CHGRID_RELEASE_VERSION} ${window.CHGRID_BUILD_REVISION}`;
|
||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||
|
||||
@@ -156,6 +156,14 @@ export function createAuthController(deps: AuthControllerDeps): {
|
||||
}
|
||||
}
|
||||
|
||||
function resetSavedSessionHint(): void {
|
||||
authUserId = '';
|
||||
authUsername = '';
|
||||
deps.saveAuthUsername('');
|
||||
deps.dom.authUsername.value = '';
|
||||
deps.dom.registerUsername.value = '';
|
||||
}
|
||||
|
||||
function updateConnectAvailability(): void {
|
||||
const hasSavedSessionHint = sanitizeAuthUsername(authUsername).length > 0;
|
||||
const showLogout = deps.isRunning() || hasSavedSessionHint;
|
||||
@@ -256,6 +264,10 @@ export function createAuthController(deps: AuthControllerDeps): {
|
||||
deps.signalingSend(packet);
|
||||
return;
|
||||
}
|
||||
if (sanitizeAuthUsername(authUsername).length > 0) {
|
||||
resetSavedSessionHint();
|
||||
setAuthMode('login');
|
||||
}
|
||||
deps.setConnecting(false);
|
||||
updateConnectAvailability();
|
||||
}
|
||||
@@ -311,6 +323,7 @@ export function createAuthController(deps: AuthControllerDeps): {
|
||||
deps.dom.registerPassword.value = '';
|
||||
deps.dom.registerPasswordConfirm.value = '';
|
||||
if (message.message.toLowerCase().includes('session')) {
|
||||
resetSavedSessionHint();
|
||||
void clearHttpOnlySessionCookie();
|
||||
}
|
||||
applyAuthPermissions('user', []);
|
||||
|
||||
Reference in New Issue
Block a user