mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-02-11 04:24:23 +01:00
html: reload page when basic auth is failed (#187)
This commit is contained in:
committed by
Shuanglei Tao
parent
2aa2035195
commit
b525417ec8
@@ -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
4
src/index.html
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user