INNER CODE UNIT · TypeScript

initAuth

dfinity/examples · motoko/vetkeys/basic_ibe/frontend/src/main.ts:273

async function initAuth() {
    const isLocal =
        window.location.hostname === "localhost" ||
        window.location.hostname.endsWith(".localhost");
    // The client mints its delegations by calling the II canister, so its agent
    // needs the network's root key to verify the responses.
    authClient = new AuthClient({
        identityProvider: {
            authorizeUrl: isLocal
                ? "http://id.ai.localhost:8000/authorize"
                : "https://id.ai/authorize",
            canisterId: "rdmx6-jaaaa-aaaaa-aaadq-cai",
        },
        agentOptions: { rootKey: canisterEnv?.IC_ROOT_KEY },
    });
    const isAuthenticated = authClient.isAuthenticated();

    if (isAuthenticated) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…