aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/client.ts')
-rw-r--r--webAO/client.ts19
1 files changed, 13 insertions, 6 deletions
diff --git a/webAO/client.ts b/webAO/client.ts
index 8ced37a..508a844 100644
--- a/webAO/client.ts
+++ b/webAO/client.ts
@@ -75,6 +75,7 @@ let hdid: string;
declare global {
interface Window {
+ handleCredentialResponse: (response: any) => void;
toggleShout: (shout: number) => void;
toggleMenu: (menu: number) => void;
updateBackgroundPreview: () => void;
@@ -237,7 +238,7 @@ class Client extends EventEmitter {
this.on('FM', this.handleFM.bind(this));
this.on('FA', this.handleFA.bind(this));
this.on('SM', this.handleSM.bind(this));
- this.on('MM', this.handleMM.bind(this));
+ this.on('2F', this.handle2F.bind(this));
this.on('BD', this.handleBD.bind(this));
this.on('BB', this.handleBB.bind(this));
this.on('KB', this.handleKB.bind(this));
@@ -493,8 +494,8 @@ class Client extends EventEmitter {
* to the server.
*/
joinServer() {
- this.sendServer(`HI#${hdid}#%`);
this.sendServer('ID#webAO#webAO#%');
+ this.sendServer(`HI#${hdid}#%`);
if (mode !== 'replay') { this.checkUpdater = setInterval(() => this.sendCheck(), 5000); }
}
@@ -1303,11 +1304,11 @@ class Client extends EventEmitter {
}
/**
- * Handles the "MusicMode" packet
+ * Handles 2 factor auth
* @param {Array} args packet arguments
*/
- handleMM(_args: string[]) {
- // It's unused nowadays, as preventing people from changing the music is now serverside
+ handle2F(_args: string[]) {
+ document.getElementById('client_secondfactor').style.display = 'block';
}
/**
@@ -3391,4 +3392,10 @@ export function toggleShout(shout: number) {
}
}
window.toggleShout = toggleShout;
-export default Client
+
+function handleCredentialResponse(response: any) {
+ client.sendServer(`2T#${response.credential}#%`);
+}
+window.handleCredentialResponse = handleCredentialResponse;
+
+export default Client \ No newline at end of file