Wheels Auth Generator

Generate CFWheels user authentication with sessions controller and bcrypt password hashing.

203|108|Updated Jan 13, 2011
One-click install
npx skills add https://github.com/wheels-dev/wheels --skill wheels-auth-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Wheels Auth Generator
Source: https://github.com/wheels-dev/wheels/tree/main/.claude/skills/wheels-auth-generator
Command: npx skills add https://github.com/wheels-dev/wheels --skill wheels-auth-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a robust and secure foundation for user authentication in CFWheels applications, automating the setup of user models, session management, and industry-standard password hashing. It ensures your application's user access is secure and reliable from the start.

Core Features & Use Cases

  • Secure User Model: Generates a user model with essential validations (presence, uniqueness, format, length) and SHA-512 password hashing.
  • Sessions Controller: Provides a complete sessions controller for handling user login, logout, and session management.
  • Authentication Filter: Includes an authentication filter to easily protect specific routes and actions, ensuring only logged-in users can access sensitive areas.
  • Use Case: Quickly set up a user login system. This skill provides the User model with email and password validations, a SessionsController for new, create, and delete actions, and a requireAuth filter to protect sensitive pages, allowing you to focus on core application features.

Quick Start

In User model:

beforeSave("hashPassword"); public any function authenticate(required string email, required string string password) { # ... authentication logic ... }

In Sessions controller:

function create() { var user = model("User").authenticate(email=params.email, password=params.password); if (isObject(user)) { session.userId = user.id; redirectTo(controller="home"); } }

Frequently Asked Questions about Wheels Auth Generator

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

FAQPage Schema
How do I set up user authentication in a CFWheels application?

User authentication in CFWheels requires a User model with password hashing, a Sessions controller to handle login and logout, and an authentication filter to protect routes. This Skill generates all three components with bcrypt-based password hashing, email and password validations, and session management so you can implement secure login workflows immediately.

What's the best way to secure passwords in a web application?

Passwords should be hashed using industry-standard algorithms like bcrypt before storage, never stored in plain text. This Skill applies bcrypt hashing automatically on user save, validates email and password formats, and implements authentication logic that compares user input against the stored hash during login.

How do I protect specific routes and require users to log in?

Protected routes need an authentication filter that checks for an active session before allowing access. This Skill includes a `requireAuth` filter you apply to sensitive controllers and actions, automatically redirecting unauthenticated users and enforcing login-only access to restricted areas.

Can I implement password reset functionality in CFWheels?

Password reset requires token generation, expiry checks, and single-use token invalidation to prevent reuse. This Skill includes a complete password-reset flow that generates secure tokens, validates their expiry, and ensures tokens become invalid after a single use.

Does this authentication system handle session management automatically?

Session management is handled by the Sessions controller, which stores the user ID in the session upon successful login and clears it on logout. The authentication filter checks this session state to determine access, automating session lifecycle across your application.

What validations are included for user registration?

The User model includes presence, uniqueness, format, and length validations for email and password fields, ensuring valid data enters your system. These validations prevent duplicate accounts, enforce password strength, and catch common user input errors before authentication attempts.