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-code

Installs 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:

  1. Install - npm install jsonwebtoken bcryptjs
  2. Register - Hash password, create user, generate token
  3. Login - Verify password, generate token
  4. 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

More from pluginagentmarketplace/custom-plugin-nodejs

All 4
1davila7 avataropentargets-databasedavila7/claude-code-templatesQuery Open Targets Platform for target-disease associations, drug target discovery, tractability/safety data, genetics/omics evidence, known drugs, for therapeu219skills.sh installs
2intellectronica avatarmonologue-notes-apiintellectronica/agent-skills>217skills.sh installs
3aradotso avatarfreellmapi-proxyaradotso/trending-skillsfreellmapi proxy212skills.sh installs
4sickn33 avatargraphql-architectsickn33/antigravity-awesome-skillsgraphql architect201skills.sh installs
5alinaqi avatardatabase-schemaalinaqi/claude-bootstrapdatabase schema200skills.sh installs
6absolutelyskilled avatarbackend-engineeringabsolutelyskilled/absolutelyskilledbackend engineering199skills.sh installs