Skip to content

magic link login - #3903

Draft
reynaldichernando wants to merge 2 commits into
HeyPuter:mainfrom
reynaldichernando:magic-link
Draft

reynaldichernando wants to merge 2 commits into
HeyPuter:mainfrom
reynaldichernando:magic-link

Conversation

@reynaldichernando

@reynaldichernando reynaldichernando commented Sep 18, 2026

Copy link
Copy Markdown
Member

add a new authentication method using sign in link (magic link)

this is to improve puter.js adoption for external apps that already have an existing authentication system
(reducing user's friction)

client (TBD):

puter.auth.signIn({ email: "user@puter.mail", returnUrl: "https://external-website.com/.../" });

to trigger the email sign in, the code must pass the authenticated user's email, and the returnUrl for where to send the user after auth success

auto fills the user email
image

email sent
image

sample email:

Email content: {
  from: '"Puter" no-reply@puter.com',
  to: 'user@puter.mail',
  subject: 'Your sign-in link for website.localhost:8080',
  html: '<p>Hi there,</p>\n' +
    '<p><strong>website.localhost:8080</strong> is powered by Puter for its AI and cloud features. Use this link to sign in:</p>\n' +
    '<p><a href="http://puter.localhost:4100/auth/magic-link/consume?token=THE_TOKEN">http://puter.localhost:4100/auth/magic-link/consume?token=THE_TOKEN</a></p>\n' +
    "<p>The link works once and expires in 15 minutes. If you didn't request it, you can ignore this email.</p>\n" +
    '<p>Sincerely,</p>\n' +
    '<p>Puter</p>'
}

(the token is not the literal auth token, but its a one time token to trigger auth and to exchange with real session)

once clicked, the user will automatically go back to the returnUrl and authed


this magic link login also works regularly for puter.com

putercom login
image
sign in with email link
image

@reynaldichernando

Copy link
Copy Markdown
Member Author

pending test how it interacts with our abuse prevention

This branch has not been deployed

No deployments
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.

1 participant