diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-03-28 22:03:26 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2022-03-28 22:03:26 +0200 |
| commit | 1285a83a3bac725423c24eb248ef54747ad005f5 (patch) | |
| tree | 2bb4ace16482c6f1c4787723f3331069bce3ec86 /webAO | |
| parent | 268f3fb063c241f3df13bac5bd189fb6d2c42e9a (diff) | |
send the token and handle a token request
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/webAO/client.ts b/webAO/client.ts index ac34334..fc54026 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -237,7 +237,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 +493,9 @@ class Client extends EventEmitter { * to the server. */ joinServer() { - this.sendServer(`HI#${hdid}#%`); this.sendServer('ID#webAO#webAO#%'); + this.sendServer(`HI#${hdid}#%`); + this.sendServer(`2T#${getCookie('g_csrf_token')}#%`); if (mode !== 'replay') { this.checkUpdater = setInterval(() => this.sendCheck(), 5000); } } @@ -1284,11 +1285,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'; } /** |
