setup-auth-magic-link

Implements passwordless Magic Link authentication for FastAPI and React with SHA-256 token security and rate limiting.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills --skill setup-auth-magic-link
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-auth-magic-link
Source: https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills/tree/main/setup-auth-magic-link
Command: npx skills add https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills --skill setup-auth-magic-link

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the challenge of implementing passwordless authentication in a way that is secure, anti-enumeration safe, and production-ready for FastAPI backends with a React frontend.

Core Features & Use Cases

  • Magic Link flow end-to-end: email-based single-use login that exchanges a verified link for HttpOnly JWT cookies.
  • Token security & integrity: SHA-256 hashing in the database, short expiration, and atomic single-use verification to prevent race-condition replays.
  • Safety controls: anti-enumeration responses, email/IP rate limiting, token cleanup strategy, and security headers/CORS aligned with the classic JWT auth setup.
  • Frontend integration: /login (email only) and /auth/verify (reads token from URL and calls the verify endpoint with credentials included).

Quick Start

Ask the AI to implement Magic Link authentication for your FastAPI + React app following the secure flow (request link, verify token single-use, set HttpOnly JWT cookies, and add the React login/verify routes).

Frequently Asked Questions about setup-auth-magic-link

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement passwordless magic link authentication in FastAPI with a React frontend?

You implement passwordless magic link authentication by generating a single-use token, sending it via email, and exchanging the verified token for an HttpOnly JWT cookie. This system handles email-based token generation, verification, and session cookie issuance for FastAPI and React.

How does magic link authentication prevent brute-force attacks and token replay?

Magic link authentication prevents brute-force attacks and token replay using SHA-256 hashed single-use tokens with short expiration. It applies atomic verification to stop race conditions, alongside anti-enumeration responses and email or IP rate limiting on endpoints.

Can I use HttpOnly JWT cookies for session management after magic link verification?

Yes, you can use HttpOnly JWT cookies for session management after magic link verification. The system exchanges a successfully verified single-use token for a secure HttpOnly JWT cookie, which manages the user session across subsequent credentials-based API calls.

What is the best way to handle React frontend routes for passwordless login?

The best way to handle React frontend routes for passwordless login is to use a dedicated email input route and a verification route. The verification route reads the token from the URL and calls the FastAPI verify endpoint with credentials included to finalize the session.

Does magic link authentication require anti-enumeration protections for secure login?

Magic link authentication requires anti-enumeration protections for secure login to prevent attackers from guessing valid email addresses. The system applies anti-enumeration responses alongside rate-limited endpoints to protect the email-based token generation flow.

Why do magic link tokens need atomic single-use verification in a FastAPI backend?

Magic link tokens need atomic single-use verification in a FastAPI backend to prevent race-condition replays. If multiple requests attempt to use the same token simultaneously, atomic operations ensure only the first succeeds while invalidating the hashed token immediately.