inertia-rails-auth

Implement Devise or has_secure_password authentication with Pundit or Action Policy in Inertia Rails.

36|1|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/cole-robertson/inertia-rails-skills --skill inertia-rails-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: inertia-rails-auth
Source: https://github.com/cole-robertson/inertia-rails-skills/tree/main/skills/inertia-rails-auth
Command: npx skills add https://github.com/cole-robertson/inertia-rails-skills --skill inertia-rails-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides clear, repeatable patterns to implement authentication and authorization in Inertia Rails applications, ensuring consistent security practices across the stack.

Core Features & Use Cases

  • Devise-based authentication: setup, sign-in, sign-out flows, and session management integrated with Inertia.
  • Authorization patterns: integration with Pundit or Action Policy to enforce per-user permissions on controllers and views.
  • Frontend state sharing: standardizes how current_user and signed_in state are exposed to Vue/React components via inertia_share.
  • CSRF & protected routes: ensures CSRF protection and secure route access; supports role-based access control for admin areas.
  • Quick Start Scenarios: provide ready-made scaffolding for login, registration, password reset, and protected pages in both Vue and React frontends.

Quick Start

  1. Add the authentication and authorization gems (e.g., devise, pundit or action_policy) to your Gemfile and run bundle install.
  2. Generate user model and authentication controllers, then wire inertia shares in ApplicationController.
  3. Implement policies and frontend guards, and apply protected routes in Rails and Inertia components.

Frequently Asked Questions about inertia-rails-auth

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

FAQPage Schema
How do I implement authentication in an Inertia Rails application?

Authentication in an Inertia Rails application is implemented by integrating Devise or has_secure_password for login flows, then wiring session management through inertia_share in ApplicationController to expose current_user state to Vue or React components.

How do I share frontend permissions and current user state with Inertia components?

Sharing frontend permissions and current user state with Inertia components requires standardizing inertia_share calls in your Rails controllers to securely pass signed_in status and Pundit or Action Policy authorization data to the frontend.

Can I use Pundit or Action Policy for authorization in an Inertia Rails app?

Pundit and Action Policy both work for authorization in an Inertia Rails app, allowing you to enforce per-user permissions on Rails controllers and apply corresponding role-based access controls and guards within your Vue or React components.

What is the best way to handle CSRF protection and secure routes with Inertia Rails?

Handling CSRF protection and secure routes with Inertia Rails involves configuring Rails to ensure CSRF tokens are properly shared and validated, while applying protected route restrictions for admin areas and authentication scopes across the stack.

How do I set up Devise login and registration scaffolding for an Inertia frontend?

Setting up Devise login and registration scaffolding for an Inertia frontend requires generating authentication controllers in Rails, wiring inertia shares, and implementing ready-made protected pages and password reset flows in your Vue or React components.