on 75770da help sign in
bridge/src/lib/useCheckExpired.ts
26 lines 542 B history raw
1import expiredPlanetsWithInviteCodes from './expiredPlanetsWithInviteCodes.json';
2import { deSiggedString } from './lib';
4export default function useIsExpired(
5 patp: string | null,
6 ticket: string | null
7) {
8 let isExpired = false;
10 if (patp !== null && ticket !== null) {
11 const ticketPatp = deSiggedString(ticket)?.concat(
12 '-',
13 deSiggedString(patp)
14 );
16 const expired = Object.keys(expiredPlanetsWithInviteCodes).includes(
17 ticketPatp
18 );
20 isExpired = expired;
21 }
23 return {
24 isExpired,
25 };