Skip to content

Commit

Permalink
html: reload page when basic auth is failed (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
shohey1226 authored and tsl0922 committed May 24, 2019
1 parent 2aa2035 commit b525417
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions html/js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/index.html

Large diffs are not rendered by default.

0 comments on commit b525417

Please sign in to comment.