/** The answers the Recomaze API gives a token it no longer accepts. */ const REJECTED_SESSION_STATUSES: ReadonlySet = new Set([401, 403]); /** * Whether a failed /me means the API turned this site's token down, so the * account will not load until the site signs in again. * * @param {number | undefined} status - The HTTP status of the failed call. * @returns {boolean} True for a refused or expired token. */ export const isRejectedSession = (status?: number): boolean => status !== undefined && REJECTED_SESSION_STATUSES.has(status);