Mirror — see github.com/blacksky-algorithms/blacksky.community
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix JWT decode crash on settings/account page

Add try/catch to isAppPassword() to handle empty or malformed
tokens gracefully instead of throwing InvalidTokenError.

+8 -3
+8 -3
src/lib/jwt.ts
··· 23 23 } 24 24 25 25 export function isAppPassword(token: string) { 26 - const payload = jwtDecode(token) 27 - // @ts-ignore 28 - return payload.scope === 'com.atproto.appPass' 26 + try { 27 + const payload = jwtDecode(token) 28 + // @ts-ignore 29 + return payload.scope === 'com.atproto.appPass' 30 + } catch { 31 + logger.error(`session: could not decode jwt in isAppPassword`) 32 + return false 33 + } 29 34 }