spree_auth_devise 4.6.2 → 4.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +8 -4
- data/app/models/spree/user.rb +6 -5
- data/config/routes.rb +25 -11
- data/lib/spree/auth/configuration.rb +6 -0
- data/lib/spree/auth/version.rb +1 -1
- data/lib/views/frontend/spree/user_sessions/new.html.erb +6 -3
- data/spec/models/user_spec.rb +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b97089602044828092a4848d896db4f9b87e56b0b285abe120faa765de715664
|
4
|
+
data.tar.gz: 9cbc7a22543f2524d62d92327f2052f930767bfe7eec95ffe7288fbc9eefa30e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d488965794fec05c47da9e7515cb39f0cce5924e9a9ebd33fc7475976458b272acdd612bac96dca9dd77f0d5c12c770402f7dab6b20b93eed394374d6fe05c5
|
7
|
+
data.tar.gz: bc18bee0f52d26b774e64375e5c51b68cf908e30a560bdeea9e7eff657bddc12a6baeb2800ddf374d2b3065a231f670763e8fecbfebd4e6a7831f0ecb55f973b
|
data/Gemfile
CHANGED
@@ -6,10 +6,14 @@ gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
|
|
6
6
|
gem 'spree_emails', github: 'spree/spree', branch: 'main'
|
7
7
|
gem 'spree_frontend', github: 'spree/spree_legacy_frontend', branch: 'main'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
platforms :ruby do
|
10
|
+
if ENV['DB'] == 'mysql'
|
11
|
+
gem 'mysql2'
|
12
|
+
elsif ENV['DB'] == 'postgres'
|
13
|
+
gem 'pg'
|
14
|
+
else
|
15
|
+
gem 'sqlite3', '~> 1.4'
|
16
|
+
end
|
13
17
|
end
|
14
18
|
|
15
19
|
gem 'pry'
|
data/app/models/spree/user.rb
CHANGED
@@ -3,15 +3,16 @@ module Spree
|
|
3
3
|
include UserAddress
|
4
4
|
include UserMethods
|
5
5
|
include UserPaymentSource
|
6
|
-
if defined?(Spree::Metadata)
|
7
|
-
include Metadata
|
8
|
-
end
|
6
|
+
include Metadata if defined?(Spree::Metadata)
|
9
7
|
|
10
|
-
devise :database_authenticatable
|
11
|
-
|
8
|
+
devise :database_authenticatable if Spree::Auth::Config[:database_authenticatable]
|
9
|
+
devise :recoverable if Spree::Auth::Config[:recoverable]
|
10
|
+
devise :registerable if Spree::Auth::Config[:registerable]
|
12
11
|
devise :confirmable if Spree::Auth::Config[:confirmable]
|
13
12
|
devise :validatable if Spree::Auth::Config[:validatable]
|
14
13
|
|
14
|
+
devise :rememberable, :trackable, :encryptable, encryptor: 'authlogic_sha512'
|
15
|
+
|
15
16
|
acts_as_paranoid
|
16
17
|
after_destroy :scramble_email_and_password
|
17
18
|
|
data/config/routes.rb
CHANGED
@@ -11,16 +11,29 @@ Spree::Core::Engine.add_routes do
|
|
11
11
|
path_prefix: :user
|
12
12
|
|
13
13
|
devise_scope :spree_user do
|
14
|
-
get '/login' => 'user_sessions#new', :as => :login
|
15
|
-
post '/login' => 'user_sessions#create', :as => :create_new_session
|
16
14
|
get '/logout' => 'user_sessions#destroy', :as => :logout
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
|
16
|
+
if Spree::Auth::Config[:database_authenticatable]
|
17
|
+
get '/login' => 'user_sessions#new', :as => :login
|
18
|
+
post '/login' => 'user_sessions#create', :as => :create_new_session
|
19
|
+
|
20
|
+
get '/password/change' => 'user_passwords#edit', :as => :edit_password
|
21
|
+
put '/password/change' => 'user_passwords#update', :as => :update_password
|
22
|
+
end
|
23
|
+
|
24
|
+
if Spree::Auth::Config[:registerable]
|
25
|
+
get '/signup' => 'user_registrations#new', :as => :signup
|
26
|
+
post '/signup' => 'user_registrations#create', :as => :registration
|
27
|
+
end
|
28
|
+
|
29
|
+
if Spree::Auth::Config[:recoverable]
|
30
|
+
get '/password/recover' => 'user_passwords#new', :as => :recover_password
|
31
|
+
post '/password/recover' => 'user_passwords#create', :as => :reset_password
|
32
|
+
end
|
33
|
+
|
34
|
+
if Spree::Auth::Config[:confirmable]
|
35
|
+
get '/confirm' => 'user_confirmations#show', :as => :confirmation
|
36
|
+
end
|
24
37
|
end
|
25
38
|
|
26
39
|
if Spree::Core::Engine.frontend_available?
|
@@ -33,12 +46,13 @@ Spree::Core::Engine.add_routes do
|
|
33
46
|
if Spree.respond_to?(:admin_path) && Spree::Core::Engine.backend_available?
|
34
47
|
namespace :admin, path: Spree.admin_path do
|
35
48
|
devise_for :spree_user,
|
36
|
-
class_name: Spree.
|
49
|
+
class_name: Spree.admin_user_class.to_s,
|
37
50
|
controllers: { sessions: 'spree/admin/user_sessions',
|
38
|
-
|
51
|
+
passwords: 'spree/admin/user_passwords' },
|
39
52
|
skip: [:unlocks, :omniauth_callbacks, :registrations],
|
40
53
|
path_names: { sign_out: 'logout' },
|
41
54
|
path_prefix: :user
|
55
|
+
|
42
56
|
devise_scope :spree_user do
|
43
57
|
get '/authorization_failure', to: 'user_sessions#authorization_failure', as: :unauthorized
|
44
58
|
get '/login' => 'user_sessions#new', :as => :login
|
@@ -4,12 +4,18 @@ module Spree
|
|
4
4
|
attr_accessor :registration_step,
|
5
5
|
:signout_after_password_change,
|
6
6
|
:confirmable,
|
7
|
+
:database_authenticatable,
|
8
|
+
:recoverable,
|
9
|
+
:registerable,
|
7
10
|
:validatable
|
8
11
|
|
9
12
|
def initialize
|
10
13
|
self.registration_step = true
|
11
14
|
self.signout_after_password_change = true
|
12
15
|
self.confirmable = false
|
16
|
+
self.database_authenticatable = true
|
17
|
+
self.recoverable = true
|
18
|
+
self.registerable = true
|
13
19
|
self.validatable = true
|
14
20
|
end
|
15
21
|
|
data/lib/spree/auth/version.rb
CHANGED
@@ -7,9 +7,12 @@
|
|
7
7
|
<%= render partial: 'spree/shared/login' %>
|
8
8
|
<div data-hook="login_extras"></div>
|
9
9
|
</div>
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
|
11
|
+
<% if Spree::Auth::Config[:registerable] %>
|
12
|
+
<div class="col-lg-11 mx-auto" data-hook="registration">
|
13
|
+
<%= render partial: 'spree/shared/registration', locals: { registration_button: 'registration-button' } %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
13
16
|
</div>
|
14
17
|
</div>
|
15
18
|
</div>
|
data/spec/models/user_spec.rb
CHANGED
@@ -106,6 +106,8 @@ RSpec.describe Spree::User, type: :model do
|
|
106
106
|
describe "#send_confirmation_instructions", retry: 2 do
|
107
107
|
let(:default_store) { Spree::Store.default }
|
108
108
|
|
109
|
+
before { Rails.application.reload_routes! }
|
110
|
+
|
109
111
|
context "when current store not exists" do
|
110
112
|
it 'takes default store and sends confirmation instruction', confirmable: true do
|
111
113
|
user = Spree.user_class.new
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_auth_devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.6.
|
4
|
+
version: 4.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
@@ -212,9 +212,9 @@ licenses:
|
|
212
212
|
- BSD-3-Clause
|
213
213
|
metadata:
|
214
214
|
bug_tracker_uri: https://github.com/spree/spree_auth_devise/issues
|
215
|
-
changelog_uri: https://github.com/spree/spree_auth_devise/releases/tag/v4.6.
|
215
|
+
changelog_uri: https://github.com/spree/spree_auth_devise/releases/tag/v4.6.3
|
216
216
|
documentation_uri: https://guides.spreecommerce.org/
|
217
|
-
source_code_uri: https://github.com/spree/spree_auth_devise/tree/v4.6.
|
217
|
+
source_code_uri: https://github.com/spree/spree_auth_devise/tree/v4.6.3
|
218
218
|
post_install_message:
|
219
219
|
rdoc_options: []
|
220
220
|
require_paths:
|