jwt-auth-guard

Verify Better Auth JWT tokens in FastAPI requests and inject authenticated users into route handlers.

Updated Dec 28, 2025
One-click install
npx skills add https://github.com/shuremali02/The-Evolution-of-Todo---Mastering-Spec-Driven-Development---Cloud-Native-AI --skill jwt-auth-guard
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: jwt-auth-guard
Source: https://github.com/shuremali02/The-Evolution-of-Todo---Mastering-Spec-Driven-Development---Cloud-Native-AI/tree/main/.claude/skills/jwt-auth-guard
Command: npx skills add https://github.com/shuremali02/The-Evolution-of-Todo---Mastering-Spec-Driven-Development---Cloud-Native-AI --skill jwt-auth-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Verifies Better Auth JWT tokens in FastAPI requests, extracts the authenticated user identity, and ensures only authorized route access.

Core Features & Use Cases

  • JWT validation and user extraction: Verifies tokens from the Authorization header and exposes user_id and email to routes.
  • Middleware/Dependency integration: Can be applied as a middleware or dependency to protect any /api/* endpoint.
  • Access control and isolation: Enforces per-user access restrictions based on the authenticated identity.

Quick Start

Integrate the jwt-auth-guard into your FastAPI app to automatically validate tokens on protected endpoints.

Frequently Asked Questions about jwt-auth-guard

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

FAQPage Schema
How do I enforce secure JWT authentication in FastAPI?▼

You enforce secure JWT authentication in FastAPI by applying this Skill as a middleware or dependency to verify Better Auth tokens and inject the authenticated user identity into route handlers.

How do I extract user identity from a JWT token in FastAPI routes?▼

You extract user identity from a JWT token in FastAPI routes by verifying the Authorization header, which exposes the user_id and email directly to your protected route handlers.

Can I use a middleware to validate Better Auth JWT tokens for FastAPI endpoints?▼

Yes, you can use a middleware to validate Better Auth JWT tokens for FastAPI endpoints, applying it to any /api/* routes to enforce per-user access control and protect sensitive resources.

What is the best way to protect sensitive REST endpoints in FastAPI with token validation?▼

The best way to protect sensitive REST endpoints in FastAPI with token validation is using a dependency that verifies JWTs and enforces per-user access restrictions based on the authenticated identity.

Does this JWT validation approach work with Better Auth tokens in FastAPI?▼

Yes, this JWT validation approach works specifically with Better Auth tokens in FastAPI, verifying them from the Authorization header to ensure only authorized route access.