export function getInstanceJwtData(qs: string) {
  try {
    const searchParams = new URLSearchParams(qs);

    const jwt = searchParams.get('instance');

    return jwt
      ? (JSON.parse(atob(jwt.split('.')[1])) as {
          uid?: string;
          metaSiteId?: string;
        })
      : null;
  } catch (e) {
    console.error('Failed to parse JWT', e);
    return null;
  }
}
