simpleweb/solidus_auth_devise

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

Homepage:

Size: 832

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Solidus Auth (Devise)

Provides authentication services for Solidus, using the Devise gem.

Installation

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
Default Username/Password

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.

Confirmable

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:

e::Auth::Config[:confirmable] = true
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.

Using in an existing application

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 %>
Testing

Run the following to automatically build a dummy app if necessary and run the tests:

le exec rake

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.