mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
oauth: fix typings
This commit is contained in:
1 parent
fc7e1e2e05
commit
084f7239be
1 file changed
+2
-2
@@ -18,8 +18,8 @@ export async function postInit() {
|
||||
if (accessToken) headers.Authorization = `Bearer ${accessToken}`;
|
||||
const socket = new WebSocket(url, { headers });
|
||||
socket.on('error', console.error);
|
||||
socket.on('message', async (message, isBinary) => {
|
||||
const payload = JSON.parse(isBinary ? message : message.toString());
|
||||
socket.on('message', async (message) => {
|
||||
const payload = JSON.parse(message.toString());
|
||||
if (payload.post_type !== 'message') return;
|
||||
if (payload.message.startsWith('login ')) {
|
||||
const secret = payload.message.split(' ')[1];
|
||||
|
||||
Reference in new issue
Block a user