๐Ÿš€ Announcement: identity.ic0.app & identity.internetcomputer.org โ†’ id.ai (Internet Identity 2.0)

:laughing:

Get your point. Iโ€™m always thinking of as less friction as possible when dealing with an UX (not the same as when you type an answer: your mind works in a different way even if answering is more complex).

Great. Will however try migrate ASAP. Right now

const identityProvider = (ENV as any).II_URL
    ? String((ENV as any).II_URL)
    : "https://identity.ic0.app/#authorize";

so I guess this changes to https://id.ai (presume the authentication handshake is now handled directly) hence

async function loginWithII(authClient: AuthClient): Promise<void> {
  const derivationOrigin =
    (ENV as any).DERIVATION_ORIGIN && String((ENV as any).DERIVATION_ORIGIN).length > 0
      ? String((ENV as any).DERIVATION_ORIGIN)
      : undefined;

  const identityProvider = (ENV as any).II_URL
    ? String((ENV as any).II_URL)
    : "https://id.ai";

  await new Promise<void>((resolve, reject) => {
    authClient.login({
      identityProvider,
      derivationOrigin,
      maxTimeToLive: DELEGATION_MAX_TTL_NS,
      onSuccess: () => resolve(),
      onError: (err) => reject(err),
    });
  });
}

While also at env level implement

export const ENV: ICPPEnv = {
   HOST: โ€œhttps://ic0.appโ€,
   NETWORK: โ€œicโ€,
   II_URL: โ€œhttps://id.aiโ€,
   DERIVATION_ORIGIN: โ€œhttps://tuaah-oaaaa-aaaai-atxxx-yyy.icp0.ioโ€,
}
2 Likes