Skip to content

Enforce admin authentication in all environments#120

Merged
xrendan merged 1 commit intomainfrom
fix/admin-auth-enforcement
Mar 27, 2026
Merged

Enforce admin authentication in all environments#120
xrendan merged 1 commit intomainfrom
fix/admin-auth-enforcement

Conversation

@xrendan
Copy link
Copy Markdown
Member

@xrendan xrendan commented Mar 27, 2026

Summary

  • Routes: Admin routes (/admin/good_job, /admin) were previously unprotected in development. Now wrapped in authenticate :user, lambda { |u| u.admin? } unconditionally.
  • Avo initializer: authenticate_with block was commented out; now enforces warden.authenticate! scope: :user so Avo itself requires authentication.

Why

Admin tooling (GoodJob dashboard, Avo) was accessible without any auth in development, which is inconsistent with production behavior and a security gap if dev environments are ever exposed.

Test plan

  • Visit /admin and /admin/good_job while logged out — expect redirect to login
  • Visit same routes as a non-admin user — expect redirect/403
  • Visit same routes as an admin user — expect access granted

🤖 Generated with Claude Code

Previously, admin routes (Avo, GoodJob) were unprotected in development
and Avo's authenticate_with block was commented out. This enforces
Warden-based auth and admin-only route guards unconditionally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@xrendan xrendan merged commit 7ff8c80 into main Mar 27, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant