html: reload page when basic auth is failed (#187)

This commit is contained in:
Shohei Kameda
2019-05-24 20:35:41 +09:00
committed by Shuanglei Tao
parent 2aa2035195
commit b525417ec8
2 changed files with 6 additions and 2 deletions

View File

@@ -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 = <number><any>setTimeout(openWs, autoReconnect * 1000);

4
src/index.html vendored

File diff suppressed because one or more lines are too long