Skip to content

[ENG-3568] Point login at the approval page, not the API root - #150

Merged
mariojgt merged 1 commit into
mainfrom
mariot/eng-3568-pulse-auth
Aug 20, 2026
Merged

[ENG-3568] Point login at the approval page, not the API root#150
mariojgt merged 1 commit into
mainfrom
mariot/eng-3568-pulse-auth

Conversation

@mariojgt

Copy link
Copy Markdown
Contributor

Pairs with patchstack/saas#1335, which adds the page this points at.

The bug

login printed:

Approve at: https://api.patchstack.com/activate

api.patchstack.com is the API origin, not the dashboard — and /activate already serves the team-seat "set a password" page. Following the link landed on an unrelated screen with nothing to approve, so the flow could not be completed.

The fix

-const verificationUri = `${new URL(base).origin}/activate`;
+const verificationUri = `${base}/device?code=${encodeURIComponent(userCode)}`;

The API redirects that to the dashboard SPA — the CLI only knows the API origin, and the page lives on the app. The code travels in the query, so following the link is a single confirmation rather than retyping it.

Approve at: …/monitor/pulse/device?code=DJ5J-RSBN
     └─ 302 ─▶ app.patchstack.com/connect?code=DJ5J-RSBN

Works from a logged-out browser too: the dashboard stores the full path through sign-in and returns to it with the code intact.

Verification

1213 tests pass, typecheck clean. The existing login test now asserts the redirect URL rather than the old one.

Merge after saas#1335 — until that deploys, the redirect target does not exist.

Ref ENG-3568

🤖 Generated with Claude Code

@coderbuds

coderbuds Bot commented Aug 19, 2026

Copy link
Copy Markdown

Login now directs users to the device approval page with clear single-click confirmation.

🎯 Quality: 84% Excellent · 📦 Size: Extra Large — strongly consider breaking this down

🛡️ Standards: no pre-flight fit check ran for this change — wire assess-change-fit into your coding agents to catch size before opening.

📈 This month: Your 56th PR — above team average · Averaging Excellent

See how your team is trending →

`login` printed {apiOrigin}/activate. That origin is the API, not the
dashboard, and /activate already serves the team-seat "set a password" page —
so following the link landed on an unrelated screen with nothing to approve.

Points at monitor/pulse/device instead, which redirects to the dashboard SPA,
and carries the code in the query so following the link is a single
confirmation rather than retyping it.

Co-Authored-By: Claude <noreply@anthropic.com>
@mariojgt
mariojgt force-pushed the mariot/eng-3568-pulse-auth branch from 0a8bb16 to a9a688e Compare August 19, 2026 14:30
@mariojgt

Copy link
Copy Markdown
Contributor Author

/review

@mariojgt
mariojgt merged commit 1259ed9 into main Aug 20, 2026
6 checks passed
@mariojgt
mariojgt deleted the mariot/eng-3568-pulse-auth branch August 20, 2026 06:48
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