Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

438 B
Raw Blame
export const LAST_AUTH_METHOD_COOKIE = 'swx_last_auth_method'
export const LAST_AUTH_METHOD_MAX_AGE = 31536000

const LAST_AUTH_METHODS = [
  'email',
  'google',
  'github',
  'openid-connect',
] as const

export type LastAuthMethod = (typeof LAST_AUTH_METHODS)[number]

export const isLastAuthMethod = (
  method: string | null | undefined,
): method is LastAuthMethod =>
  LAST_AUTH_METHODS.some((authMethod) => authMethod === method)