Add magic link authentication for secure passwordless login#17
Merged
Neverdecel merged 1 commit intomainfrom Jan 25, 2026
Merged
Add magic link authentication for secure passwordless login#17Neverdecel merged 1 commit intomainfrom
Neverdecel merged 1 commit intomainfrom
Conversation
Replace insecure direct email login with magic link flow:
- Add MAGIC_LINK token type to verification model
- Add magic link methods to VerificationService (create, verify, rate limit)
- Modify POST /api/login to send magic link email instead of creating session
- Add GET /api/auth/magic/{token} endpoint for token verification
- Update login template with two-state UI (email entry + check email)
- Add branded HTML email template for magic links
Security: single-use tokens, 15-min expiry, hashed storage, rate limiting,
no email enumeration (same response for existing/non-existing emails)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
models/verification.pyMAGIC_LINKtoken type to enumservices/verification.pyapi/onboarding.py/api/auth/magic/{token}verificationtemplates/login.htmlstatic/style.cssSecurity Features
Testing
/loginDevOps Notes
No infrastructure changes required. Uses existing: