migration to postgres
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -50,7 +50,7 @@ const devServerWebsocket = {
|
||||
try {
|
||||
const payload = await verify(wsToken);
|
||||
if (!payload) { ws.close(4001, 'Unauthorized'); return; }
|
||||
if (payload.jti && isTokenBlacklisted(payload.jti)) { ws.close(4001, 'Unauthorized'); return; }
|
||||
if (payload.jti && await isTokenBlacklisted(payload.jti)) { ws.close(4001, 'Unauthorized'); return; }
|
||||
} catch {
|
||||
ws.close(4001, 'Unauthorized');
|
||||
return;
|
||||
@@ -108,7 +108,7 @@ async function upgradeWs(req: Request, server: any, provider: 'terminal' | 'pi')
|
||||
if (!user) return new Response('Unauthorized', { status: 401 });
|
||||
|
||||
if (user.jti) {
|
||||
if (isTokenBlacklisted(user.jti)) return new Response('Unauthorized', { status: 401 });
|
||||
if (await isTokenBlacklisted(user.jti)) return new Response('Unauthorized', { status: 401 });
|
||||
}
|
||||
|
||||
const url = new URL(req.url);
|
||||
|
||||
Reference in New Issue
Block a user