jwt-auth

Implement JWT authentication with refresh token rotation using jsonwebtoken and ioredis.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill jwt-auth-dadbodgeoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jwt-auth
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/jwt-auth
Command: npx skills add https://github.com/dadbodgeoff/drift --skill jwt-auth-dadbodgeoff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jsonwebtoken, ioredis, express, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a robust solution for implementing secure JSON Web Token (JWT) authentication with refresh token rotation, ensuring secure and stateless authentication for applications.

Core Features & Use Cases

  • Secure JWT Authentication: Implements access and refresh tokens for secure user sessions.
  • Refresh Token Rotation: Enhances security by rotating refresh tokens on each use, invalidating previous ones.
  • Secure Storage: Recommends storing refresh tokens in httpOnly cookies and access tokens in memory.
  • Automatic Renewal: Facilitates automatic token renewal to maintain user sessions without frequent re-authentication.
  • Use Case: Ideal for Single Page Applications (SPAs), mobile apps, or APIs requiring stateless authentication with enhanced security and seamless user experience.

Quick Start

Use the jwt-auth skill to generate a new pair of access and refresh tokens for a given user.

Frequently Asked Questions about jwt-auth

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

FAQPage Schema
How do I implement refresh token rotation for JWT authentication?

Refresh token rotation for JWT authentication is implemented by generating a new token pair on each use, invalidating the previous refresh token to prevent security vulnerabilities. This ensures secure stateless sessions.

What is the best way to manage JWT authentication for a Single Page Application?

The best way to manage JWT authentication for a Single Page Application is using stateless access and refresh tokens, storing refresh tokens in httpOnly cookies and access tokens in memory to facilitate automatic renewal.

How does storing access tokens in memory and refresh tokens in httpOnly cookies work?

Storing access tokens in memory and refresh tokens in httpOnly cookies works by mitigating cross-site scripting attacks, using the httpOnly cookie to automatically renew the in-memory access token and maintain a seamless user session.

Can I use Redis and Express for stateless JWT token verification?

Yes, you can use Redis and Express for stateless JWT token verification. The implementation utilizes the ioredis library for secure token storage and rotation logic, alongside Express for API endpoint management.

Why does automatic token renewal prevent security vulnerabilities in APIs?

Automatic token renewal prevents security vulnerabilities in APIs by rotating refresh tokens upon each use. This invalidates stolen or previously used tokens, ensuring secure user sessions without requiring frequent re-authentication.