Skip to content

feat: automatic portal login after connecting - #31

Merged
CallMeTechie merged 2 commits into
masterfrom
feat/portal-auto-login
Oct 6, 2026
Merged

CallMeTechie merged 2 commits into
masterfrom
feat/portal-auto-login

Conversation

@CallMeTechie

Copy link
Copy Markdown
Owner

Summary

The client now opens the portal with a one-time login link, so the user lands in the portal already signed in. This applies to:

  • the auto-open after connecting (shouldOpenPortal → openPortalSafe());

  • the tray entry;

  • the "Portal öffnen" button.

  • openPortalSafe() now uses createPortalOpener() from the core. Right before every open, it calls apiClient.getPortalLink() (POST /api/v1/client/portal-link with the usual client headers). Every open fetches a fresh link; nothing is cached.

  • It falls back to the plain portalUrl on a non-2xx answer, a network error, a timeout over 5 s, a missing url, or a url whose origin differs from portalUrl. Only https URLs are opened, as before.

  • The renderer button now calls window.gatecontrol.portal.open() (new portal:open channel, served by the core via ctx.openPortal). The main process fetches and opens the link, so the ticket never reaches the renderer. The ticket is not logged or stored anywhere.

  • Tests: the IPC test now covers portal:open.

⚠️ Core pin points at the unmerged core PR

core.ref is pinned to c2f100745161dcd5994374b105ef49b4621c8c4c, the head of CallMeTechie/gatecontrol-client-core#18 (branch feat/portal-auto-login). CI fetches that commit directly, so this PR builds and tests against it now.

Before merging this PR: merge the core PR first, then bump core.ref to the resulting core master commit (npm run core:bump, or bash scripts/bump-core.sh <sha>) so the client does not stay pinned to a branch commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_016xX1efcZF1f6G9rhmaJNLD


Generated by Claude Code

Claude added 2 commits October 6, 2026 18:32
Open the portal with a fresh one-time login link from the server instead of
the plain portal URL, for the auto-open after connect, the tray entry and the
"Portal öffnen" button. Falls back to the portal URL when the server has no
valid link (older server, error, timeout, foreign origin).

- openPortalSafe() now uses core createPortalOpener(), which calls
  apiClient.getPortalLink() right before every open (no caching).
- The renderer button calls window.gatecontrol.portal.open(); main fetches
  and opens the link, so the ticket never reaches the renderer.
- core.ref pinned to the core commit that adds getPortalLink().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016xX1efcZF1f6G9rhmaJNLD
@CallMeTechie
CallMeTechie merged commit 7d348e0 into master Oct 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants