From b525417ec86fff4a1d4dd9fb57888ae5174b0c90 Mon Sep 17 00:00:00 2001 From: Shohei Kameda Date: Fri, 24 May 2019 20:35:41 +0900 Subject: [PATCH] html: reload page when basic auth is failed (#187) --- html/js/app.ts | 4 ++++ src/index.html | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/html/js/app.ts b/html/js/app.ts index 5436850..d74ca8a 100644 --- a/html/js/app.ts +++ b/html/js/app.ts @@ -208,6 +208,10 @@ const openWs = function(): void { } } window.removeEventListener('beforeunload', unloadCallback); + // 1008: POLICY_VIOLATION - Auth failure + if (event.code === 1008) { + location.reload(); + } // 1000: CLOSE_NORMAL if (event.code !== 1000 && autoReconnect > 0) { term.reconnectTimeout = setTimeout(openWs, autoReconnect * 1000); diff --git a/src/index.html b/src/index.html index 72495c9..2faa92d 100644 --- a/src/index.html +++ b/src/index.html @@ -1,3 +1,3 @@ ttyd - Terminal
\ No newline at end of file +/*# sourceMappingURL=app.9cb3870e18634056c702.css.map */
\ No newline at end of file -- 2.43.4