
Jwt Authentication
This is your standard JWT authentication implementation for Node.js, covering the essentials: bcrypt password hashing, access and refresh tokens, auth middleware, and role-based access control. The skill walks through registration, login, and route protection with practical examples, then gets into token refresh flows and password resets. It bonds with the Node.js fundamentals skill, which makes sense since you need to understand Express routing and async patterns before tackling auth. The security checklist is solid (short-lived access tokens, HTTPS, rate limiting), though nothing groundbreaking. Use this when you're building a REST API and need stateless authentication that scales horizontally without session storage headaches.
- skills.sh installs
- 226
- GitHub stars
- 2
- last updated
- Aug 21, 2026
Install
$ npx -y skills add pluginagentmarketplace/custom-plugin-nodejs --skill jwt-authentication --agent claude-codeInstalls into .claude/skills of the current project.
Files
JWT Authentication Skill
Implement secure, scalable authentication in Node.js applications using JSON Web Tokens.
Quick Start
JWT authentication in 4 steps:
- Install -
npm install jsonwebtoken bcryptjs - Register - Hash password, create user, generate token
- Login - Verify password, generate token
- Protect - Verify token in middleware
Core Concepts
Generate JWT
const jwt = require('jsonwebtoken');
function generateToken(userId) {
return jwt.sign(
{ id: userId },
process.env.JWT_SECRET,
{ expiresIn: '1h' }
);
}
function generateRefreshToken(userId) {
return jwt.sign(
{ id: userId },
process.env.JWT_REFRESH_SECRET,
{ expiresIn: '7d' }
);
}
User Registration
const bcrypt = require('bcryptjs');
async function register(req, res) {
const { email, password, name } = req.body;
// Check if user exists
const existingUser = await User.findOne({ email });
if (existingUser) {
return res.status(409).json({ error: 'User already exists' });
}
// Hash password
const hashedPassword = await bcrypt.hash(password, 10);
Sponsors
Details
- Repository
- github.com/pluginagentmarketplace/custom-plugin-nodejs
- Categories
- Backend & APIs, Security
- First seen
- Jun 3, 2026