auth

Implement JWT authentication with refresh token rotation in Node.js backends.

3|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill auth-mauriciodelrio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth
Source: https://github.com/mauriciodelrio/delriodev-skills/tree/main/es-skills/software/backend/auth
Command: npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill auth-mauriciodelrio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Backend developers often need a reliable, secure way to implement authentication and authorization in Node.js applications, handling tokens, password hashing, and access control without reinventing the wheel.

Core Features & Use Cases

  • JWT management: access and refresh token generation, rotation, and secure storage in httpOnly cookies.
  • Password hashing: bcrypt or Argon2 best‑practice configurations.
  • OAuth2/social login: integration guidelines for providers like Google.
  • RBAC: role‑based guards for NestJS and Express.
  • Logout & security gotchas: token blacklisting, cookie clearing, and common pitfalls.

Quick Start

Use the auth skill to configure JWT authentication with refresh token rotation in a NestJS backend.

Frequently Asked Questions about auth

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

FAQPage Schema
How do I implement JWT refresh token rotation in a NestJS backend?

To implement JWT refresh token rotation in NestJS, generate new access and refresh tokens upon each refresh request, store them securely in httpOnly cookies, and blacklist compromised tokens to prevent unauthorized reuse.

What is the best way to set up OAuth2 social login in Node.js?

The best way to set up OAuth2 social login in Node.js is to use integration guidelines for providers like Google, handling the authorization code flow and securely managing the resulting tokens within your Express or NestJS application.

Can I use RBAC guards for role-based access control in Express applications?

Yes, you can implement RBAC in Express applications by applying role-based guards to protect routes, ensuring only users with specific roles can access protected backend resources.

Does bcrypt or Argon2 work better for password hashing in Node.js?

Both bcrypt and Argon2 work well for password hashing in Node.js, but Argon2 is generally recommended for modern applications due to its resistance to GPU-based attacks, while bcrypt offers proven reliability and easier configuration.

Why do I need to blacklist JWT tokens on logout?

You need to blacklist JWT tokens on logout because JSON Web Tokens are stateless; blacklisting ensures that a valid token cannot be reused by malicious actors after the user has cleared their secure cookies and ended the session.

Are there common security pitfalls when implementing authentication in Node.js?

Common authentication security pitfalls in Node.js include failing to use httpOnly cookies for token storage, neglecting token blacklisting during logout, and improperly configuring password hashing algorithms like bcrypt or Argon2.