A decentralized music tracking and discovery platform built on AT Protocol 🎵

[api] ignore jwt expiration

+9 -3
+9 -3
apps/api/src/websocket/handler.ts
··· 58 59 if (deviceMessage.success) { 60 const { data, device_id, token } = deviceMessage.data; 61 - const { did } = jwt.verify(token, env.JWT_SECRET); 62 // broadcast to all devices 63 userDevices[did].forEach(async (id) => { 64 const targetDevice = devices[id]; ··· 169 170 if (controlMessage.success) { 171 const { type, target, action, args, token } = controlMessage.data; 172 - const { did } = jwt.verify(token, env.JWT_SECRET); 173 console.log( 174 `Control message: ${chalk.greenBright(type)}, ${chalk.greenBright(target)}, ${chalk.greenBright(action)}, ${chalk.greenBright(args)}, ${chalk.greenBright("***")}` 175 ); ··· 207 `Register message: ${chalk.greenBright(type)}, ${chalk.greenBright(clientName)}, ${chalk.greenBright("****")}` 208 ); 209 // Handle register Message 210 - const { did } = jwt.verify(token, env.JWT_SECRET); 211 const deviceId = uuidv4(); 212 ws.deviceId = deviceId; 213 ws.did = did;
··· 58 59 if (deviceMessage.success) { 60 const { data, device_id, token } = deviceMessage.data; 61 + const { did } = jwt.verify(token, env.JWT_SECRET, { 62 + ignoreExpiration: true, 63 + }); 64 // broadcast to all devices 65 userDevices[did].forEach(async (id) => { 66 const targetDevice = devices[id]; ··· 171 172 if (controlMessage.success) { 173 const { type, target, action, args, token } = controlMessage.data; 174 + const { did } = jwt.verify(token, env.JWT_SECRET, { 175 + ignoreExpiration: true, 176 + }); 177 console.log( 178 `Control message: ${chalk.greenBright(type)}, ${chalk.greenBright(target)}, ${chalk.greenBright(action)}, ${chalk.greenBright(args)}, ${chalk.greenBright("***")}` 179 ); ··· 211 `Register message: ${chalk.greenBright(type)}, ${chalk.greenBright(clientName)}, ${chalk.greenBright("****")}` 212 ); 213 // Handle register Message 214 + const { did } = jwt.verify(token, env.JWT_SECRET, { 215 + ignoreExpiration: true, 216 + }); 217 const deviceId = uuidv4(); 218 ws.deviceId = deviceId; 219 ws.did = did;