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
59
if (deviceMessage.success) {
60
const { data, device_id, token } = deviceMessage.data;
61
-
const { did } = jwt.verify(token, env.JWT_SECRET);
0
0
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);
0
0
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);
0
0
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;