components/OAuthLoginModal.tsx

hermes-desktop · src/renderer/src/components/OAuthLoginModal.tsx · typescript · MIT
auth

Modal component for OAuth login flow with progress and error handling.

// Source: https://github.com/fathah/hermes-desktop | License: MIT | Copyright 2026 github.com/fathah
// Provided via justclaw.it.com; keep this notice with the code.
import { useState, useEffect, useRef } from "react";
import { X } from "../assets/icons";
import { useI18n } from "./useI18n";

interface OAuthLoginModalProps {
  provider: string;
  providerLabel: string;
  profile?: string;
  onClose: () => void;
}

type Status = "running" | "success" | "error";

/**
 * Drives an interactive OAuth sign-in for a subscription provider.
 * Spawns `hermes auth add <provider> --type oauth` in the main process,
 * streams the CLI output here, and reports success/failure. The CLI
 * opens the system browser for the consent step.
 */
function OAuthLoginModal({
  provider,
  providerLabel,
  profile

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key