-
Notifications
You must be signed in to change notification settings - Fork 637
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
Fix: Autoload CryptoProvider classes #406
Conversation
(fixes a bug where scrypt/bcrypt gems are required to run Authlogic -- let's just require them when necessary)
rw_config(:crypto_provider, CryptoProviders::SCrypt) | ||
else | ||
rw_config(:crypto_provider, value) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only semi-weird part. Loading SCrypt
here would require the gem (even w/autoload). So I only set it as the default if the provider hasn't been set yet.
It works, but another alternative could be allowing procs as the rw_config
value?
+1 for this |
+1, also addresses my issue #405. |
+1 |
1 similar comment
+1 |
Fix: Autoload CryptoProvider classes
thx! @yourewelcome you weren't out at RailsConf, were you? |
No, I wanted to go, couldn't make it this year. |
In a recent commit (c2eae1c) I removed some old require code for bcrypt/scrypt.
This ends up throwing the
LoadError
in your app if you don't have those two gems in your Gemfile, but we still don't necessarily need the gems to run Authlogic.This change autoloads each
CryptoProvider
when necessary rather than requiring all of them when loading Authlogic.