All Projects → spree → Spree_auth_devise

spree / Spree_auth_devise

Licence: bsd-3-clause
Provides authentication (user accounts, login & signup) for @spree by using Devise

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Spree auth devise

Milia
Easy multi-tenanting for Rails5 (or Rails4) + Devise
Stars: ✭ 326 (+162.9%)
Mutual labels:  rails, devise
Devise masquerade
Extension for devise, enable login as functionality. Add link to the masquerade_path(resource) and use it.
Stars: ✭ 380 (+206.45%)
Mutual labels:  rails, devise
Spree i18n
I18n translation files for Spree Commerce.
Stars: ✭ 338 (+172.58%)
Mutual labels:  ecommerce, rails
Spree
Open Source headless multi-language/multi-currency/multi-store eCommerce platform
Stars: ✭ 11,571 (+9231.45%)
Mutual labels:  ecommerce, rails
Odoo Shopinvader
Odoo Modules. Sorry Magento, Shopinvader is coming
Stars: ✭ 60 (-51.61%)
Mutual labels:  ecommerce, rails
Spree starter
Dockerized @spree demo & starter template
Stars: ✭ 297 (+139.52%)
Mutual labels:  ecommerce, rails
Angular Token
🔑 Token based authentication service for Angular with interceptor and multi-user support. Works best with devise token auth for Rails. Example:
Stars: ✭ 376 (+203.23%)
Mutual labels:  rails, devise
Solidus
🛒Solidus, Rails eCommerce System
Stars: ✭ 3,985 (+3113.71%)
Mutual labels:  ecommerce, rails
Furatto Rails Start Kit
A rails app with Furatto, Devise, and Facebook Authentication perfect for hackathons!
Stars: ✭ 46 (-62.9%)
Mutual labels:  rails, devise
Devise Jwt
JWT token authentication with devise and rails
Stars: ✭ 881 (+610.48%)
Mutual labels:  rails, devise
Devise invitable
An invitation strategy for devise
Stars: ✭ 2,491 (+1908.87%)
Mutual labels:  rails, devise
Graphql devise
GraphQL interface on top devise_token_auth
Stars: ✭ 100 (-19.35%)
Mutual labels:  rails, devise
Limestone
Boilerplate Rails 6 SaaS application with Webpack, Stimulus and Docker integration.
Stars: ✭ 191 (+54.03%)
Mutual labels:  rails, devise
Devise token auth
Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Stars: ✭ 3,263 (+2531.45%)
Mutual labels:  rails, devise
Doorkeeper Provider App
An example OAuth 2 provider application using the Doorkeeper gem, Rails and Devise
Stars: ✭ 146 (+17.74%)
Mutual labels:  rails, devise
Devise
Flexible authentication solution for Rails with Warden.
Stars: ✭ 22,088 (+17712.9%)
Mutual labels:  rails, devise
Instuigram
🎓 Learning Ruby on Rails through building the Instagram Application.
Stars: ✭ 88 (-29.03%)
Mutual labels:  rails, devise
Simple token authentication
Simple (but safe) token authentication for Rails apps or API with Devise.
Stars: ✭ 1,474 (+1088.71%)
Mutual labels:  rails, devise
Slidehub
SlideHub is an Open Source Slide Sharing Application for Azure / AWS
Stars: ✭ 120 (-3.23%)
Mutual labels:  rails
Globodns
Api to manage Bind Name Server
Stars: ✭ 122 (-1.61%)
Mutual labels:  rails

Spree Auth (Devise)

Build Status Code Climate

Provides authentication services for Spree, using the Devise gem.

Installation

  1. Add this extension to your Gemfile with this line:
gem 'spree_auth_devise'

if you run into any version-mismatch problems please run bundle update

  1. Install the gem using Bundler:
bundle install
  1. Copy & run migrations
bundle exec rails g spree:auth:install

Upgrading from Spree 3.0 to 3.1

If you're upgrading from 3.0 to 3.1 you need to rerun the installer to copy new asset files (javascripts)

bundle exec rails g spree:auth:install

Configuration

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:

  • Add this line to an initializer in your Rails project (typically config/initializers/spree.rb):
Spree::Auth::Config[:confirmable] = true
  • Add a Devise initializer to your Rails project (typically config/initializers/devise.rb):
Devise.setup do |config|
  # Required so users don't lose their carts when they need to confirm.
  config.allow_unconfirmed_access_for = 1.days

  # Fixes the bug where Confirmation errors result in a broken page.
  config.router_name = :spree

  # Add any other devise configurations here, as they will override the defaults provided by spree_auth_devise.
end

Sign out after password change

To disable signout after password change you must add this line to an initializer in your Rails project (typically config/initializers/spree.rb):

Spree::Auth::Config[:signout_after_password_change] = false

Using in an existing Rails application

If you are installing Spree inside of a host application in which you want your own permission setup, you can do this using spree_auth_devise's register_ability method.

First create your own CanCan Ability class following the CanCan documentation.

For example: app/models/your_ability_class.rb

class YourAbilityClass
  include CanCan::Ability

  def initialize user
    # direct permissions
     can :create, SomeRailsObject

     # or permissions by group
     if spree_user.has_spree_role? "admin"
       can :create, SomeRailsAdminObject
     end
   end
end

Then register your class in your spree initializer: config/initializers/spree.rb

Spree::Ability.register_ability(YourAbilityClass)

Inside of your host application you can then use CanCan like you normally would.

<% if can? :show, SomeRailsObject %>

<% end %>

Adding Permissions to Gems

This methodology can also be used by gems that extend spree and want/need to add permissions.

Ruby 2.5 issues

If you encounter issues when using Ruby 2.5, please run:

bundle update devise

Creating the default Admin user

If you didn't created the Admin user from the installer you can run this rake task:

bundle exec rake spree_auth:admin:create

Testing

You need to do a quick one-time creation of a test application and then you can use it to run the tests.

bundle exec rake test_app

Then run the rspec tests.

bundle exec rspec

About Spark Solutions

Spark Solutions

Spree Auth Devise is maintained by Spark Solutions Sp. z o.o..

We are passionate about open source software. We are available for hire.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].