-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active_admin issue #47
Comments
@ACPK - I don't think Active Admin will be able to share the same I haven't used Active Admin in a while - is it possible to configure it so that it doesn't inherit from |
Got a quick fix using an HTTP auth though I'll add a seperate model later. I added this to the active_admin initializer: config.before_filter do |
@ACPK - the model should be fine. The issue is that Active Admin is expecting Devise to work using sessions, but AngularJS needs Devise to work using tokens. Rails can't work both ways at the same time using the same routes and controllers. I'm not sure what the solution is, but it may involve mounting Devise routes in the standard way (using Let me know if you figure this out and I'll post a note in the README. |
Would an alternative workaround be to have all the API controllers inherit from a separate subclass of ApplicationController, say, APIController < ApplicationController, which includes the token authentication concern, so that the ApplicationController is untouched? I'm relatively new to using this gem, so I'm not sure what kinds of drawbacks this might have. |
I have this situation in my app, but my ActiveAdmin is mounted under a different subdomain. So I did two things: In my routes, I add devise functionality separately depending on the subdomain:
And then I have my API Controllers subclass from Api::ApiController to include the controller concerns, so they don't clutter the ApplicationController global namespace that ActiveAdmin shares.
|
@wkoffel Thanks! |
I got it working based on @wkoffel answer but without subdomains (a great thing if you are using Heroku without a custom domain): routes.rb
app/controllers/application_controller.rb
app/controllers/api/api_controller.rb
And all of my api controllers (except the ones from Devise) do: |
The following code in my application_controller.rb is causing a "wrong number of arguments (1 for 0)".
When I take out "DeviseTokenAuth::Concerns::SetUserByToken", the error goes away....
I have:
The text was updated successfully, but these errors were encountered: