getPendingInvite.tsx 334 B

123456789101112131415161718
  1. import Cookies from 'js-cookie';
  2. import * as qs from 'query-string';
  3. type PendingInvite = {
  4. memberId: number;
  5. token: string;
  6. url: string;
  7. };
  8. export default function getPendingInvite(): PendingInvite | null {
  9. const data = Cookies.get('pending-invite');
  10. if (!data) {
  11. return null;
  12. }
  13. return qs.parse(data) as any;
  14. }