diff options
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/dom/twofactor.ts | 11 | ||||
| -rw-r--r-- | webAO/dom/window.ts | 1 | ||||
| -rw-r--r-- | webAO/packets/packets.ts | 2 | ||||
| -rw-r--r-- | webAO/styles/client.css | 11 |
4 files changed, 25 insertions, 0 deletions
diff --git a/webAO/dom/twofactor.ts b/webAO/dom/twofactor.ts new file mode 100644 index 0000000..28b6e6c --- /dev/null +++ b/webAO/dom/twofactor.ts @@ -0,0 +1,11 @@ +import { client } from "../client"; + +function handleCredentialResponse(response: any) { + console.log(response); + client.sender.sendServer(`2T#${response.credential}#%`); + } +window.handleCredentialResponse = handleCredentialResponse; + +export function showFactorDialog(display: string) { + document.getElementById("client_secondfactor").style.display = display; +}
\ No newline at end of file diff --git a/webAO/dom/window.ts b/webAO/dom/window.ts index 2535768..956526c 100644 --- a/webAO/dom/window.ts +++ b/webAO/dom/window.ts @@ -51,6 +51,7 @@ declare global { onEnter: (event: any) => void; onReplayGo: (_event: any) => void; onOOCEnter: (_event: any) => void; + handleCredentialResponse: (_event: any) => void; } } export { }
\ No newline at end of file diff --git a/webAO/packets/packets.ts b/webAO/packets/packets.ts index 79c43c1..c9d0bb8 100644 --- a/webAO/packets/packets.ts +++ b/webAO/packets/packets.ts @@ -2,6 +2,7 @@ import { handleMS } from './handlers/handleMS'; import { handleCT } from './handlers/handleCT' import { handleMC } from './handlers/handleMC' import { handleRMC } from './handlers/handleRMC' +import { showFactorDialog } from '../dom/twofactor' import { handleFL } from './handlers/handleFL' import { handleLE } from './handlers/handleLE' import { handleEM } from './handlers/handleEM' @@ -47,6 +48,7 @@ export const packets = { "CI": handleCI, "SC": handleSC, "EI": handleEI, + "2A": showFactorDialog, "FL": handleFL, "LE": handleLE, "EM": handleEM, diff --git a/webAO/styles/client.css b/webAO/styles/client.css index 8c7898b..31bc64b 100644 --- a/webAO/styles/client.css +++ b/webAO/styles/client.css @@ -75,6 +75,17 @@ animation: error_blink 3s ease-in-out infinite; } +#client_secondfactor { + display: block; + flex-direction: column; + justify-content: center; + text-align: center; + align-items: center; + background: black; + color: lightgreen; + font-size: large; +} + #client_waiting { display: block; flex-direction: column; |
