Name: solidus_auth_devise
Owner: Simpleweb
Description: Adds devise authentication to solidus
Forked from: solidusio/solidus_auth_devise
Created: 2017-12-04 12:50:31.0
Updated: 2017-12-04 12:50:33.0
Pushed: 2017-12-04 12:54:12.0
Size: 832
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Provides authentication services for Solidus, using the Devise gem.
Just add this line to your Gemfile
:
"solidus_auth_devise"
Then, run bundle install
.
After that's done, you can install and run the necessary migrations, then seed the database:
le exec rake solidus_auth:install:migrations
le exec rake db:migrate
le exec rake db:seed
As part of running the above installation steps, you will be asked to set an admin email/password combination. The default values are admin@example.com
and test123
, respectively.
To enable Devise's Confirmable module, which will send the user an email with a link to confirm their account, you must do the following:
config/initializers/spree.rb
):e::Auth::Config[:confirmable] = true
config/initializers/devise.rb
):se.setup do |config|
Required so users don't lose their carts when they need to confirm.
nfig.allow_unconfirmed_access_for = 1.days
Fixes the bug where Confirmation errors result in a broken page.
nfig.router_name = :spree
Add any other devise configurations here, as they will override the defaults provided by solidus_auth_devise.
If you are installing Solidus inside of a host application in which you want your own permission setup, you can do this using the register_ability
method.
First create your own CanCan Ability class following the CanCan documentation.
For example: app/models/super_abilities.rb
s SuperAbilities
clude CanCan::Ability
f initialize user
if user.is? "Superman"
can :stop, Bullet
end
d
Then register your class in your spree initializer: config/initializers/spree.rb
e::Ability.register_ability(SuperAbilities)
Inside of your host application you can then use CanCan like you normally would.
f can? :stop Bullet %>
.
nd %>
Run the following to automatically build a dummy app if necessary and run the tests:
le exec rake