Agent skill

jwt

JWT implementation, token management, refresh patterns, and security.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/jwt-a5c-ai-babysitter

SKILL.md

JWT Skill

Expert assistance for JWT authentication implementation.

Capabilities

  • Generate and verify tokens
  • Implement refresh tokens
  • Handle token storage
  • Configure expiration
  • Secure token handling

Implementation

typescript
import jwt from 'jsonwebtoken';

function generateTokens(user: User) {
  const accessToken = jwt.sign(
    { id: user.id, role: user.role },
    process.env.JWT_SECRET!,
    { expiresIn: '15m' }
  );

  const refreshToken = jwt.sign(
    { id: user.id },
    process.env.REFRESH_SECRET!,
    { expiresIn: '7d' }
  );

  return { accessToken, refreshToken };
}

function verifyToken(token: string) {
  return jwt.verify(token, process.env.JWT_SECRET!);
}

Target Processes

  • jwt-authentication
  • auth-implementation
  • api-security

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results