Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
117
fork

Configure Feed

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

at a876aae44ea07494ebea9727350aa060b81f317b 29 lines 796 B view raw
1import {jwtDecode} from 'jwt-decode' 2 3import {logger} from '#/logger' 4 5/** 6 * Simple check if a JWT token has expired. Does *not* validate the token or check for revocation status, 7 * just checks the expiration time. 8 * 9 * @param token The JWT token to check. 10 * @returns `true` if the token has expired, `false` otherwise. 11 */ 12export function isJwtExpired(token: string) { 13 try { 14 const payload = jwtDecode(token) 15 16 if (!payload.exp) return true 17 const now = Math.floor(Date.now() / 1000) 18 return now >= payload.exp 19 } catch { 20 logger.error(`session: could not decode jwt`) 21 return true // invalid token or parse error 22 } 23} 24 25export function isAppPassword(token: string) { 26 const payload = jwtDecode(token) 27 // @ts-ignore 28 return payload.scope === 'com.atproto.appPass' 29}