tangled
alpha
login
or
join now
t1c.dev
/
rocksky
forked from
rocksky.app/rocksky
2
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
2
fork
atom
overview
issues
pulls
pipelines
[api] ignore jwt expiration
tsiry-sandratraina.com
8 months ago
988c1916
d3de26b8
+9
-3
1 changed file
expand all
collapse all
unified
split
apps
api
src
websocket
handler.ts
+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
61
-
const { did } = jwt.verify(token, env.JWT_SECRET);
61
61
+
const { did } = jwt.verify(token, env.JWT_SECRET, {
62
62
+
ignoreExpiration: true,
63
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
172
-
const { did } = jwt.verify(token, env.JWT_SECRET);
174
174
+
const { did } = jwt.verify(token, env.JWT_SECRET, {
175
175
+
ignoreExpiration: true,
176
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
210
-
const { did } = jwt.verify(token, env.JWT_SECRET);
214
214
+
const { did } = jwt.verify(token, env.JWT_SECRET, {
215
215
+
ignoreExpiration: true,
216
216
+
});
211
217
const deviceId = uuidv4();
212
218
ws.deviceId = deviceId;
213
219
ws.did = did;