Skip to content

Sign in by a code or a link to codegrave.com - #49

Merged
ashrawan merged 1 commit into
mainfrom
claude/project-thread-jn4wta
Nov 28, 2026
Merged

ashrawan merged 1 commit into
mainfrom
claude/project-thread-jn4wta

Conversation

@ashrawan

Copy link
Copy Markdown
Owner

Requested by Shrawan · project thread

What this changes

  • After "Email me a sign-in link", the "Check your inbox" dialog now also takes the code from the email and signs in on the spot.
  • A link that opens codegrave.com with a one-time key after # (#token_hash=…&type=email) is traded for a session when the page loads.
  • docs/ACCOUNTS.md gives the email template to set in the sign-in service's dashboard so the email links to codegrave.com and shows the code.

Why

The sign-in email's link pointed at the sign-in service's own address, not codegrave.com. Careful readers and browser agents refuse to open a link like that. With this change the email can link to codegrave.com or carry only a code. The key sits after #, so it never reaches a server, and a mail scanner that fetches the link cannot use it up.

The dashboard template is not changed by this PR. Until someone changes it, sign-in works exactly as before.

Kind

  • New entry
  • Correction to an entry
  • New view
  • Image or icon
  • The page (site/)
  • Scripts, rules, tests or docs

Sources

  • None (no dates changed)

Screenshots

The "Check your inbox" dialog with the code field (phone): signin-code/code-390.png and code-1440.png in the project files.

Local link to see it: / → Sign in → enter an email.

Checklist

  • node scripts/build.mjs --check prints 0 errors
  • node --test passes
  • Every date I added or changed has a source listed on the entry
  • I did not change the id of an existing entry or view
  • Screenshots are included, or nothing on the page changes
  • If I changed the page, the browser console is clean at 1440 and 390 px (only the mocked 403 from the wrong-code test)
  • An AI assistant helped with this change, and I checked its facts against the sources (tick only if it applies)
  • I agree my contribution is licensed as described in LICENSE (MIT for code, CC BY-NC-SA 4.0 for content)

Tested in Playwright with the sign-in service mocked: a typed code calls verify with the email and code, and a #token_hash link signs in and clears the address. Not tested against the live service.


Generated by Claude Code

The sign-in email's link pointed at the sign-in service's own address. The
page now takes the code from the email, and trades a one-time key left after
'#' by a link to codegrave.com for a session, so the email template can send
either without the service's address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MCuMSfetGcKCVLNDJsJfC8
@ashrawan ashrawan self-assigned this Nov 28, 2026
@netlify

netlify Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ubiquitous-smakager-593fec ready!

Name Link
🔨 Latest commit b2ad256
🔍 Latest deploy log https://app.netlify.com/projects/ubiquitous-smakager-593fec/deploys/6b0a84acd1067fc503cbaf62
😎 Deploy Preview https://deploy-preview-49--ubiquitous-smakager-593fec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ashrawan
ashrawan merged commit 8c12914 into main Nov 28, 2026
5 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