AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Inertia Rails Auth

skill-cole-robertson-inertia-rails-skills-inertia-rails-auth · by cole-robertson

Implement authentication and authorization in Inertia Rails applications. Use when setting up login, sessions, permissions, and access control with Devise, has_secure_password, or other auth solutions.

No reviews yet
0 installs
3 views
0.0% view→install

Install

$ agentstack add skill-cole-robertson-inertia-rails-skills-inertia-rails-auth

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-cole-robertson-inertia-rails-skills-inertia-rails-auth)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Inertia Rails Auth? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Inertia Rails Authentication & Authorization

Guide to implementing authentication and authorization in Inertia Rails applications.

Key Principle

Inertia uses your existing Rails authentication infrastructure. No special OAuth or token-based auth required. Since your frontend and backend share the same domain, session-based auth works seamlessly.

Authentication with Devise

Setup

# Gemfile
gem 'devise'
bundle install
rails generate devise:install
rails generate devise User
rails db:migrate

Share Authentication State

# app/controllers/application_controller.rb
class ApplicationController  reset('password'),
    })
  }

  return (
    
      Sign In

      
        Email
         setData('email', e.target.value)}
          autoFocus
        />
        {errors.email && {errors.email}}
      

      
        Password
         setData('password', e.target.value)}
        />
      

      
        
           setData('remember', e.target.checked)}
          />
          Remember me
        
      

      
        {processing ? 'Signing in...' : 'Sign In'}
      

      
        Create an account
        Forgot password?
      
    
  )
}

Login Component (Vue)


import { useForm, Link } from '@inertiajs/vue3'

const form = useForm({
  email: '',
  password: '',
  remember: false,
})

function submit() {
  form.post('/users/sign_in', {
    onSuccess: () => form.reset('password'),
  })
}

  
    Sign In

    
      Email
      
      {{ form.errors.email }}
    

    
      Password
      
    

    
      
        
        Remember me
      
    

    
      {{ form.processing ? 'Signing in...' : 'Sign In' }}
    

    
      Create an account
      Forgot password?
    
  

Authentication with hassecurepassword

User Model

# app/models/user.rb
class User 
      Users

      {can.create_user && (
        
          Create User
        
      )}

      
        {users.map((user) => (
          
            {user.name}

            {user.can.edit && (
              Edit
            )}

            {user.can.delete && (
              
                Delete
              
            )}
          
        ))}
      
    
  )
}

Frontend Permission Checks (Vue)


import { Link, usePage } from '@inertiajs/vue3'

const props = defineProps(['users', 'can'])
const { auth } = usePage().props

  
    Users

    
    
      Create User
    

    
      
        {{ user.name }}

        
        
          Edit
        

        
          Delete
        
      
    
  

History Encryption

Prevent sensitive data exposure via browser back button after logout:

# config/initializers/inertia_rails.rb
InertiaRails.configure do |config|
  # Enable globally
  config.encrypt_history = true
end

# Or per-controller for sensitive areas
class Admin::BaseController  {
  const { auth } = usePage().props
  if (!auth.signed_in && requiresAuth(page.component)) {
    router.visit('/login')
  }
})

5. Implement Rate Limiting

# Gemfile
gem 'rack-attack'

# config/initializers/rack_attack.rb
Rack::Attack.throttle('login attempts', limit: 5, period: 60) do |req|
  req.ip if req.path == '/login' && req.post?
end

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.