Skip to content
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

Devise should be a soft dependency #542

Closed
pcreux opened this issue Sep 28, 2011 · 16 comments
Closed

Devise should be a soft dependency #542

pcreux opened this issue Sep 28, 2011 · 16 comments

Comments

@pcreux
Copy link
Contributor

pcreux commented Sep 28, 2011

ActiveAdmin comes from a generator which takes care of setting up a basic authentication mechanism using Devise.

Devise is a depency of ActiveAdmin while it could just be a soft dependency.

This would issues that people encounter when their Rails application uses Warden but not Devise (#178).

See also #519.

@safarista
Copy link

I remember first time I tried it, I slowed my dev server so bad I fell out with my co-developer. We are still fighting even today. The dev server on both our machines is blazingly slow.

I sure thought it was devise causing it and suggested to change it to "Sorcery" or make it a very soft dependency or not at all. Well by not at all I mean, require a current_user! of some sort, so anyone can implement there own Auth however they like.

REF: #519

Its quick in production though. Just saying.

@j-manu
Copy link
Contributor

j-manu commented Dec 20, 2011

Is this being worked on ?

@safarista
Copy link

Not sure. No comments yet from @pcreux.

Just thought with the resent release of Warden the authentication would be simplified to allow multiple user types to exist in Rack middleware == warden. Am I even making sense!!! Its late going to bed.

@pcreux
Copy link
Contributor Author

pcreux commented Dec 21, 2011

Nop, this is not being worked on.

Feel free to contribute! :)

@j-manu
Copy link
Contributor

j-manu commented Dec 21, 2011

I would like to take a shot. Did you have any plan in mind for this? Make it configurable or split that part into a separate gem? (is that possible?)

@pcreux
Copy link
Contributor Author

pcreux commented Dec 21, 2011

So basically,

  • remove devise from gemspec
  • load lib/active_admin/devise.rb only if the authentication uses devise.

And I let you see how you can figure out "if the authentication uses devise". :)

That's the plan I had in mind. Not sure if it helps. :)

@groe
Copy link

groe commented Dec 29, 2011

In my current project I am using sorcery for authentication - a very lightweight solution. I removed all occurrences of devise (configs, routes) and everything works fine - but it would be nice if I could finally uninstall the 'devise' gem :)

IMO authentication is not even activeadmin's job and should be fully independent (or maybe as a plugin?).

@rdj
Copy link
Contributor

rdj commented Jan 31, 2012

This has gotten slightly more annoying recently, since I'm getting these to stderr when my server starts up:

[DEVISE] Devise.case_insensitive_keys is false which is no longer supported. If you want to continue running on this mode, please ensure you are not using validatable (you can copy the validations directly to your model) and set case_insensitive_keys to an empty array.

[DEVISE] Devise.use_salt_as_remember_token is false which is no longer supported. Devise now only uses the salt as remember token and the remember_token column can be removed from your models.

[DEVISE] Devise.reset_password_within is nil. Please set this value to an interval (for example, 6.hours) and add a reset_password_sent_at field to your Devise models (if they don't have one already).

@groe
Copy link

groe commented Jan 31, 2012

Yep, same here.

@killercup
Copy link

Also struggling with this. Any news?

@toao
Copy link

toao commented Feb 20, 2012

Here's an ugly workaround to at least hide those annoying warnings during server startup. I've put the following lines to the activeadmin-initializer:

Devise.case_insensitive_keys = []
Devise.reset_password_within = 14.days # anything but false/nil possible
Devise.use_salt_as_remember_token = nil

That did it for good :D

We're using authlogic here, so setting those values should be save (at least for us).

@dennybritz
Copy link

+1 to this.

@houen
Copy link

houen commented Feb 23, 2012

Thank you @toao for geting rid of my pesky error messages for a gem I'm not actually using :-)

@seanlinsley
Copy link
Contributor

Let's get this done!

@PapePathe
Copy link

Really i would like to

@naps62
Copy link

naps62 commented Mar 5, 2014

how are we on this?

lautis added a commit to lautis/active_admin that referenced this issue Apr 2, 2014
Load devise only when the dependency is fulfilled. Show an error 
message when running generator without devise gem.

Fixes activeadmin#542.
lautis added a commit to lautis/active_admin that referenced this issue Apr 2, 2014
Load devise only when the dependency is fulfilled. Show an error 
message when running generator without devise gem.

Fixes activeadmin#542.
lautis added a commit to lautis/active_admin that referenced this issue Apr 2, 2014
Load devise only when the dependency is fulfilled. Show an error 
message when running generator without devise gem.

Fixes activeadmin#542.
lautis added a commit to lautis/active_admin that referenced this issue Apr 5, 2014
Load devise only when the dependency is fulfilled. Show an error 
message when running generator without devise gem.

Fixes activeadmin#542.
lautis added a commit to lautis/active_admin that referenced this issue May 7, 2014
Load devise only when the dependency is fulfilled. Show an error
message when running generator without devise gem.

Fixes activeadmin#542.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.