Skip to content

fix(auth): drop ignored magicLink allowedAttempts option#319

Merged
mortondev merged 1 commit into
mainfrom
fix/remove-magiclink-allowed-attempts
Jun 29, 2026
Merged

fix(auth): drop ignored magicLink allowedAttempts option#319
mortondev merged 1 commit into
mainfrom
fix/remove-magiclink-allowed-attempts

Conversation

@mortondev

@mortondev mortondev commented Jun 29, 2026

Copy link
Copy Markdown
Member

What

Removes the allowedAttempts: 3 option from the magic-link plugin config.

Why

better-auth consumes magic-link tokens atomically on the first verification call, so allowedAttempts has no effect for any value other than 1 (GHSA-hc7v-rggr-4hvx). The library now emits a startup warning for any non-default value.

The option's original intent (per the comment it carried) was to tolerate Outlook Safe Links / Slack unfurl prefetching the link and burning the token before the human clicks. That concern is already handled elsewhere: the email links to the /verify-magic-link interstitial, which only calls the token-consuming verify endpoint from a client-side useEffect. Non-browser scanners don't execute JS, so they never consume the token. See apps/web/src/routes/verify-magic-link.tsx.

So the option was both non-functional (per the GHSA) and redundant with the interstitial. Dropping it is behaviour-preserving and silences the warning.

better-auth consumes magic-link tokens atomically on the first
verification call, so allowedAttempts has no effect for any value
other than 1 (GHSA-hc7v-rggr-4hvx). Remove the option to silence
the startup warning.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@mortondev mortondev merged commit b5358c7 into main Jun 29, 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.

1 participant