{"id":13878861,"url":"https://github.com/spree/spree_auth_devise","last_synced_at":"2025-05-14T01:03:06.689Z","repository":{"id":3343807,"uuid":"4388369","full_name":"spree/spree_auth_devise","owner":"spree","description":"Provides authentication (user accounts, login \u0026 signup) for @spree 4 by using Devise","archived":false,"fork":false,"pushed_at":"2025-03-03T11:57:11.000Z","size":1566,"stargazers_count":141,"open_issues_count":46,"forks_count":496,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-04-02T11:15:32.172Z","etag":null,"topics":["auth","authentication","devise","ecommerce","rails","spree","spreecomerce","userauthentication"],"latest_commit_sha":null,"homepage":"https://spreecommerce.org","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spree.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-05-20T23:57:25.000Z","updated_at":"2025-03-13T13:40:33.000Z","dependencies_parsed_at":"2025-01-28T13:13:25.036Z","dependency_job_id":"c1380ff6-f79e-436f-a378-a606403193a4","html_url":"https://github.com/spree/spree_auth_devise","commit_stats":{"total_commits":840,"total_committers":149,"mean_commits":"5.6375838926174495","dds":0.7142857142857143,"last_synced_commit":"b048a33b0771130f4c0cdf503dc2eb5125107e91"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spree%2Fspree_auth_devise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spree%2Fspree_auth_devise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spree%2Fspree_auth_devise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spree%2Fspree_auth_devise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spree","download_url":"https://codeload.github.com/spree/spree_auth_devise/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","authentication","devise","ecommerce","rails","spree","spreecomerce","userauthentication"],"created_at":"2024-08-06T08:02:02.329Z","updated_at":"2025-05-14T01:03:06.683Z","avatar_url":"https://github.com/spree.png","language":"Ruby","readme":"# ⚠️ Warning - maintenance mode\n\nThis gem is only usable for Spree below version 5.0 (eg, Spree 4.x). For Spree 5 you do not need this gem.\n\n[Authentication with Devise in Spree 5 tutorial](https://spreecommerce.org/docs/developer/customization/authentication#using-devise)\n\n# Spree Auth Devise\n\n[![CircleCI](https://circleci.com/gh/spree/spree_auth_devise/tree/main.svg?style=svg)](https://circleci.com/gh/spree/spree_auth_devise/tree/main)\n\nProvides authentication services for [Spree](https://spreecommerce.org), using the [Devise](https://github.com/plataformatec/devise) gem.\n\n## Installation\n\n1. Add this extension to your Gemfile with this line:\n\n  ```ruby\n  gem 'spree_auth_devise'\n  ```\n  \n  if you run into any version-mismatch problems please run `bundle update`\n\n2. Install the gem using Bundler:\n  ```ruby\n  bundle install\n  ```\n\n3. Copy \u0026 run migrations\n  ```ruby\n  bundle exec rails g spree:auth:install\n  ```\n\n## Upgrading from Spree 3.0 to 3.1\n\nIf you're upgrading from 3.0 to 3.1 you need to rerun the installer to copy new asset files (javascripts)\n\n```ruby\nbundle exec rails g spree:auth:install\n```\n\n## Configuration\n\n### Confirmable\n\nTo enable Devise's Confirmable module, which will send the user an email with a link to confirm their account, you must do the following:\n\n* Add this line to an initializer in your Rails project (typically `config/initializers/spree.rb`):\n```ruby\nSpree::Auth::Config[:confirmable] = true\n```\n\n* Add a Devise initializer to your Rails project (typically `config/initializers/devise.rb`):\n```ruby\nDevise.setup do |config|\n  # Required so users don't lose their carts when they need to confirm.\n  config.allow_unconfirmed_access_for = 1.days\n\n  # Fixes the bug where Confirmation errors result in a broken page.\n  config.router_name = :spree\n\n  # Add any other devise configurations here, as they will override the defaults provided by spree_auth_devise.\nend\n```\n\n### Sign out after password change\n\nTo disable signout after password change you must add this line to an initializer in your Rails project (typically `config/initializers/spree.rb`):\n\n```ruby\nSpree::Auth::Config[:signout_after_password_change] = false\n```\n\n## Using in an existing Rails application\n\nIf 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.\n\nFirst create your own CanCan Ability class following the CanCan documentation.\n\nFor example: app/models/your_ability_class.rb\n\n```ruby\nclass YourAbilityClass\n  include CanCan::Ability\n\n  def initialize user\n    # direct permissions\n     can :create, SomeRailsObject\n\n     # or permissions by group\n     if spree_user.has_spree_role? \"admin\"\n       can :create, SomeRailsAdminObject\n     end\n   end\nend\n```\n\nThen register your class in your spree initializer: config/initializers/spree.rb\n```ruby\nSpree::Ability.register_ability(YourAbilityClass)\n```\n\nInside of your host application you can then use CanCan like you normally would.\n```ruby\n\u003c% if can? :show, SomeRailsObject %\u003e\n\n\u003c% end %\u003e\n```\n\n### Adding Permissions to Gems\n\nThis methodology can also be used by gems that extend spree and want/need to add permissions.\n\n### Ruby 2.5 issues\n\nIf you encounter issues when using Ruby 2.5, please run:\n\n```bash\nbundle update devise\n```\n\n### Creating the default Admin user\n\nIf you didn't created the Admin user from the installer you can run this rake task:\n\n```bash\nbundle exec rake spree_auth:admin:create\n```\n\n## Testing\n\nYou need to do a quick one-time creation of a test application and then you can use it to run the tests.\n\n    bundle exec rake test_app\n\nThen run the rspec tests.\n\n    bundle exec rspec\n\n\n## License\n\nSpree Starter (formerly Spark Starter Kit) is copyright © 2015-2021\n[Spark Solutions Sp. z o.o.][spark]. It is free software,\nand may be redistributed under the terms specified in the\n[LICENSE](LICENSE.md) file.\n\n## About Spark Solutions\n\n[![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]\n\nSpree Auth Devise is maintained and funded by [Spark Solutions Sp. z o.o.](http://sparksolutions.co?utm_source=github)\nThe names and logos are trademarks of Spark Solutions Sp. z o.o.\n\nWe are passionate about open source software.\nWe are [available for hire][spark].\n\n[spark]:http://sparksolutions.co?utm_source=github\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspree%2Fspree_auth_devise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspree%2Fspree_auth_devise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspree%2Fspree_auth_devise/lists"}