From 19f457bdabb1d2319908f28e6242c39b85a644f2 Mon Sep 17 00:00:00 2001 From: Wesley Finck Date: Tue, 4 Nov 2025 00:14:54 -0500 Subject: [PATCH] style: format token.ts with linter rules Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) --- src/webapp/lib/auth/token.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/webapp/lib/auth/token.ts b/src/webapp/lib/auth/token.ts index b07df485..a55ee13b 100644 --- a/src/webapp/lib/auth/token.ts +++ b/src/webapp/lib/auth/token.ts @@ -13,13 +13,11 @@ export const isTokenExpiringSoon = ( const parts = token.split('.'); if (parts.length !== 3) return true; - const payload = JSON.parse( - Buffer.from(parts[1], 'base64').toString(), - ); - + const payload = JSON.parse(Buffer.from(parts[1], 'base64').toString()); + // Ensure exp claim exists and is a number if (!payload.exp || typeof payload.exp !== 'number') return true; - + const expiry = payload.exp * 1000; const bufferTime = bufferSeconds * 1000; return Date.now() >= expiry - bufferTime; -- 2.51.2