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