Skip to content

Uninitialized constant Devise::SessionsController when extending controller #8160

Closed Answered by javierjulio
mcfoton asked this question in Help
Discussion options

You must be logged in to vote

A few things to note. I believe the approach has to be class ActiveAdmin::Devise::SessionsController instead of a module with Zeitwerk but not sure if that will help much based on the Rails guide. It could be that it occurs because those files are in our lib and not in the app folder so I wonder if related to that. I've seen past issues bring this up.

All I can do is share what I've done in my app for a long time now and it works fine with Rails 7 and Zeitwerk. Also, I think this would be preferred since you'd want to customize most things like the view too. We take this approach to use Okta for admin login.

In routes, declare the new sessions controller:

  devise_for :admin_users, Active…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mcfoton
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #8159 on December 07, 2023 15:19.