Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Updates the authentication flow to direct users to the browser for magic link generation instead of handling email collection and API requests via the CLI. This aligns the CLI experience with the standard web authentication flow.

Changes

  • Login Command (src/commands/login.ts):
    • Replaced promptForEmail and requestMagicLink logic with a call to open() targeting https://client.joinforma.com/login?type=magic.
    • Removed --email option and email persistence logic since the CLI no longer handles the initial request.
    • Updated user prompts to guide them through the browser interaction and subsequent link pasting.
  • Dependencies: Added open package to handle cross-platform browser opening.
  • Tests: Added src/commands/login.test.ts to validate the new interaction flow and updated Jest configuration to support the ESM-only open package.

Example Interaction

// Old flow
// > Enter your email: user@example.com
// > Magic link sent! Paste it here: ...

// New flow
// > We need to authenticate you with Forma.
// > A browser window will open to https://client.joinforma.com/login?type=magic
// > Please enter your email address there to receive a magic link.
// > Once you receive the email, copy the magic link and paste it here.
// [Browser opens]
// > Copy and paste the magic link sent to your email, then press Enter.
Original prompt

Update the login command so that instead of collecting a user's email and pinging it to Forma yo get a magic link, it pops open a browser to https://client.joinforma.com/login?type=magic to enter the email and request the link. The flow afterwards where the user pastes the magic link into the terminal should be the same. Before popping open the browser, explain what is going to happen and that they need to enter their email, get the magic link, and then come back to the terminal to paste.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 4, 2025 10:04
Co-authored-by: timrogers <116134+timrogers@users.noreply.github.com>
Co-authored-by: timrogers <116134+timrogers@users.noreply.github.com>
Copilot AI changed the title [WIP] Update login command to use browser for magic link Refactor login flow to use browser-based magic link request Dec 4, 2025
Copilot AI requested a review from timrogers December 4, 2025 10:17
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