Jwt
Skill a5c-ai/babysitter/library/specializations/web-development/skills/jwt
Babysitter enforces obedience on agentic workforces and enables them to manage extremely complex tasks and workflows through deterministic, hallucination-free self-orchestration
npx -y skills add a5c-ai/babysitter --skill jwtAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
JWT implementation, token management, refresh patterns, and security.
SKILL.md
1.2 KB, as published. Nobody here has run it
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
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