solidus_auth_devise 2.0.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.circleci/config.yml +35 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +17 -0
- data/.gitignore +12 -8
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +284 -145
- data/Gemfile +22 -14
- data/{LICENSE.md → LICENSE} +2 -2
- data/README.md +50 -3
- data/Rakefile +2 -0
- data/app/mailers/spree/user_mailer.rb +4 -2
- data/app/models/spree/auth_configuration.rb +2 -0
- data/app/models/spree/user.rb +30 -20
- data/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface +20 -0
- data/bin/console +17 -0
- data/bin/rails +12 -4
- data/bin/setup +8 -0
- data/config/initializers/devise.rb +11 -3
- data/config/initializers/warden.rb +4 -2
- data/config/locales/en.yml +4 -1
- data/config/locales/fr.yml +1 -1
- data/config/locales/it.yml +4 -4
- data/config/routes.rb +16 -15
- data/db/default/users.rb +10 -8
- data/db/migrate/20101026184949_create_users.rb +9 -7
- data/db/migrate/20101026184950_rename_columns_for_devise.rb +3 -1
- data/db/migrate/20101214150824_convert_user_remember_field.rb +2 -0
- data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +2 -0
- data/db/migrate/20120605211305_make_users_email_index_unique.rb +4 -2
- data/db/migrate/20140904000425_add_deleted_at_to_users.rb +2 -0
- data/db/migrate/20141002154641_add_confirmable_to_users.rb +2 -0
- data/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb +34 -0
- data/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb +7 -0
- data/db/seeds.rb +2 -0
- data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +7 -4
- data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +12 -10
- data/lib/controllers/frontend/spree/user_confirmations_controller.rb +2 -0
- data/lib/controllers/frontend/spree/user_passwords_controller.rb +4 -1
- data/lib/controllers/frontend/spree/user_registrations_controller.rb +4 -0
- data/lib/controllers/frontend/spree/user_sessions_controller.rb +4 -2
- data/lib/controllers/frontend/spree/users_controller.rb +20 -15
- data/lib/decorators/backend/controllers/spree/admin/base_controller_decorator.rb +20 -0
- data/lib/decorators/backend/controllers/spree/admin/orders/customer_details_controller_decorator.rb +22 -0
- data/lib/{controllers/frontend → decorators/frontend/controllers}/spree/checkout_controller_decorator.rb +29 -19
- data/lib/generators/solidus/auth/install/install_generator.rb +15 -3
- data/lib/generators/solidus/auth/install/templates/config/initializers/devise.rb +3 -1
- data/lib/solidus/auth.rb +2 -0
- data/lib/solidus_auth_devise.rb +13 -5
- data/lib/spree/auth/devise.rb +2 -7
- data/lib/spree/auth/engine.rb +51 -38
- data/lib/spree/auth/version.rb +7 -0
- data/lib/spree/authentication_helpers.rb +5 -11
- data/lib/tasks/auth.rake +3 -1
- data/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb +13 -6
- data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +4 -4
- data/lib/views/backend/spree/admin/user_passwords/new.html.erb +6 -8
- data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +1 -1
- data/lib/views/backend/spree/admin/user_sessions/new.html.erb +9 -9
- data/lib/views/backend/spree/layouts/admin/_login_nav.html.erb +4 -4
- data/lib/views/frontend/spree/checkout/registration.html.erb +4 -4
- data/lib/views/frontend/spree/shared/_login.html.erb +4 -4
- data/lib/views/frontend/spree/shared/_login_bar.html.erb +2 -6
- data/lib/views/frontend/spree/shared/_login_bar_items.html.erb +6 -0
- data/lib/views/frontend/spree/shared/_user_form.html.erb +3 -3
- data/lib/views/frontend/spree/user_passwords/edit.html.erb +4 -4
- data/lib/views/frontend/spree/user_passwords/new.html.erb +5 -7
- data/lib/views/frontend/spree/user_registrations/new.html.erb +3 -3
- data/lib/views/frontend/spree/user_sessions/authorization_failure.html.erb +1 -1
- data/lib/views/frontend/spree/user_sessions/new.html.erb +2 -2
- data/lib/views/frontend/spree/users/edit.html.erb +2 -2
- data/lib/views/frontend/spree/users/show.html.erb +12 -12
- data/solidus_auth_devise.gemspec +38 -31
- data/spec/controllers/spree/admin/base_controller_spec.rb +53 -0
- data/spec/controllers/spree/admin/user_passwords_controller_spec.rb +14 -0
- data/spec/controllers/spree/base_controller_spec.rb +53 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +6 -10
- data/spec/controllers/spree/products_controller_spec.rb +6 -3
- data/spec/controllers/spree/user_passwords_controller_spec.rb +4 -3
- data/spec/controllers/spree/user_registrations_controller_spec.rb +3 -2
- data/spec/controllers/spree/user_sessions_controller_spec.rb +14 -0
- data/spec/controllers/spree/users_controller_spec.rb +26 -8
- data/spec/factories/confirmed_user.rb +7 -5
- data/spec/features/account_spec.rb +4 -3
- data/spec/features/admin/password_reset_spec.rb +66 -10
- data/spec/features/admin/products_spec.rb +2 -1
- data/spec/features/admin/sign_in_spec.rb +2 -1
- data/spec/features/admin/sign_out_spec.rb +2 -1
- data/spec/features/admin_permissions_spec.rb +2 -1
- data/spec/features/change_email_spec.rb +3 -2
- data/spec/features/checkout_spec.rb +14 -37
- data/spec/features/confirmation_spec.rb +6 -10
- data/spec/features/order_spec.rb +2 -1
- data/spec/features/password_reset_spec.rb +23 -10
- data/spec/features/sign_in_spec.rb +2 -1
- data/spec/features/sign_out_spec.rb +4 -3
- data/spec/features/sign_up_spec.rb +2 -1
- data/spec/mailers/user_mailer_spec.rb +2 -1
- data/spec/models/order_spec.rb +2 -1
- data/spec/models/user_spec.rb +57 -38
- data/spec/spec_helper.rb +13 -9
- data/spec/support/ability.rb +3 -1
- data/spec/support/authentication_helpers.rb +2 -0
- data/spec/support/confirm_helpers.rb +23 -10
- data/spec/support/email.rb +2 -0
- data/spec/support/features/fill_addresses_fields.rb +29 -0
- data/spec/support/preferences.rb +10 -2
- data/spec/support/spree.rb +2 -0
- metadata +327 -243
- data/.travis.yml +0 -22
- data/app/overrides/auth_admin_login_navigation_bar.rb +0 -11
- data/app/overrides/auth_shared_login_bar.rb +0 -10
- data/circle.yml +0 -6
- data/lib/assets/javascripts/spree/backend/solidus_auth.js +0 -1
- data/lib/assets/javascripts/spree/frontend/solidus_auth.js +0 -1
- data/lib/assets/stylesheets/spree/backend/solidus_auth.css +0 -3
- data/lib/assets/stylesheets/spree/frontend/solidus_auth.css +0 -3
- data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +0 -11
- data/lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb +0 -20
- data/lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb +0 -15
- data/spec/features/admin/orders_spec.rb +0 -30
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
prepend_before_action :check_registration,
|
|
3
|
-
except: [:registration, :update_registration]
|
|
4
|
-
prepend_before_action :check_authorization
|
|
1
|
+
# frozen_string_literal: true
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
module Spree
|
|
4
|
+
module CheckoutControllerDecorator
|
|
5
|
+
def self.prepended(base)
|
|
6
|
+
base.before_action :check_registration, except: [:registration, :update_registration]
|
|
7
|
+
base.before_action :check_authorization
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
# This action builds some associations on the order, ex. addresses, which we
|
|
10
|
+
# don't to build or save here.
|
|
11
|
+
base.skip_before_action :setup_for_current_state, only: [:registration, :update_registration]
|
|
12
|
+
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
if params[:order][:email] =~ Devise.email_regexp && current_order.update_attributes(email: params[:order][:email])
|
|
16
|
-
redirect_to spree.checkout_path
|
|
17
|
-
else
|
|
18
|
-
flash[:registration_error] = t(:email_is_invalid, scope: [:errors, :messages])
|
|
14
|
+
def registration
|
|
19
15
|
@user = Spree::User.new
|
|
20
|
-
render 'registration'
|
|
21
16
|
end
|
|
22
|
-
end
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
def update_registration
|
|
19
|
+
if params[:order][:email] =~ Devise.email_regexp && current_order.update(email: params[:order][:email])
|
|
20
|
+
redirect_to spree.checkout_path
|
|
21
|
+
else
|
|
22
|
+
flash[:registration_error] = t(:email_is_invalid, scope: [:errors, :messages])
|
|
23
|
+
@user = Spree::User.new
|
|
24
|
+
render 'registration'
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
25
30
|
def order_params
|
|
26
31
|
params.
|
|
27
32
|
fetch(:order, {}).
|
|
@@ -39,6 +44,7 @@ Spree::CheckoutController.class_eval do
|
|
|
39
44
|
# Introduces a registration step whenever the +registration_step+ preference is true.
|
|
40
45
|
def check_registration
|
|
41
46
|
return unless registration_required?
|
|
47
|
+
|
|
42
48
|
store_location
|
|
43
49
|
redirect_to spree.checkout_registration_path
|
|
44
50
|
end
|
|
@@ -53,7 +59,7 @@ Spree::CheckoutController.class_eval do
|
|
|
53
59
|
end
|
|
54
60
|
|
|
55
61
|
def guest_authenticated?
|
|
56
|
-
current_order
|
|
62
|
+
current_order&.email.present? &&
|
|
57
63
|
Spree::Config[:allow_guest_checkout]
|
|
58
64
|
end
|
|
59
65
|
|
|
@@ -61,6 +67,10 @@ Spree::CheckoutController.class_eval do
|
|
|
61
67
|
# are redirected to the tokenized order url unless authenticated as a registered user.
|
|
62
68
|
def completion_route
|
|
63
69
|
return spree.order_path(@order) if spree_current_user
|
|
70
|
+
|
|
64
71
|
spree.token_order_path(@order, @order.guest_token)
|
|
65
72
|
end
|
|
73
|
+
|
|
74
|
+
::Spree::CheckoutController.prepend self
|
|
75
|
+
end
|
|
66
76
|
end
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Solidus
|
|
2
4
|
module Auth
|
|
3
5
|
module Generators
|
|
4
6
|
class InstallGenerator < Rails::Generators::Base
|
|
7
|
+
class_option :auto_run_migrations, type: :boolean, default: false
|
|
8
|
+
class_option :skip_migrations, type: :boolean, default: false
|
|
9
|
+
|
|
5
10
|
def self.source_paths
|
|
6
|
-
paths =
|
|
7
|
-
paths << File.expand_path('
|
|
11
|
+
paths = superclass.source_paths
|
|
12
|
+
paths << File.expand_path('templates', __dir__)
|
|
8
13
|
paths.flatten
|
|
9
14
|
end
|
|
10
15
|
|
|
@@ -17,7 +22,14 @@ module Solidus
|
|
|
17
22
|
end
|
|
18
23
|
|
|
19
24
|
def run_migrations
|
|
20
|
-
|
|
25
|
+
return if options[:skip_migrations]
|
|
26
|
+
|
|
27
|
+
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
|
|
28
|
+
if run_migrations
|
|
29
|
+
run 'bundle exec rake db:migrate'
|
|
30
|
+
else
|
|
31
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!' # rubocop:disable Rails/Output
|
|
32
|
+
end
|
|
21
33
|
end
|
|
22
34
|
end
|
|
23
35
|
end
|
data/lib/solidus/auth.rb
CHANGED
data/lib/solidus_auth_devise.rb
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'solidus_core'
|
|
4
|
+
require 'solidus_support'
|
|
5
|
+
require 'deface'
|
|
6
|
+
require 'devise'
|
|
7
|
+
require 'devise-encryptable'
|
|
8
|
+
require 'cancan'
|
|
9
|
+
|
|
10
|
+
require 'spree/auth/devise'
|
|
11
|
+
require 'spree/auth/version'
|
|
12
|
+
require 'spree/auth/engine'
|
|
13
|
+
require 'spree/authentication_helpers'
|
data/lib/spree/auth/devise.rb
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
require 'devise'
|
|
3
|
-
require 'devise-encryptable'
|
|
4
|
-
require 'cancan'
|
|
1
|
+
# frozen_string_literal: true
|
|
5
2
|
|
|
6
3
|
module Spree
|
|
7
4
|
module Auth
|
|
8
|
-
def self.config
|
|
5
|
+
def self.config
|
|
9
6
|
yield(Spree::Auth::Config)
|
|
10
7
|
end
|
|
11
8
|
end
|
|
12
9
|
end
|
|
13
|
-
|
|
14
|
-
require 'spree/auth/engine'
|
data/lib/spree/auth/engine.rb
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'devise'
|
|
2
4
|
require 'devise-encryptable'
|
|
3
5
|
|
|
4
6
|
module Spree
|
|
5
7
|
module Auth
|
|
6
8
|
class Engine < Rails::Engine
|
|
9
|
+
include SolidusSupport::EngineExtensions
|
|
10
|
+
|
|
7
11
|
isolate_namespace Spree
|
|
8
12
|
engine_name 'solidus_auth'
|
|
9
13
|
|
|
10
|
-
initializer "spree.auth.environment", before: :load_config_initializers do |
|
|
14
|
+
initializer "spree.auth.environment", before: :load_config_initializers do |_app|
|
|
11
15
|
Spree::Auth::Config = Spree::AuthConfiguration.new
|
|
12
16
|
end
|
|
13
17
|
|
|
@@ -16,65 +20,74 @@ module Spree
|
|
|
16
20
|
end
|
|
17
21
|
|
|
18
22
|
config.to_prepare do
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
auth.prepare_backend if SolidusSupport.backend_available?
|
|
22
|
-
auth.prepare_frontend if SolidusSupport.frontend_available?
|
|
23
|
+
Spree::Auth::Engine.prepare_backend if SolidusSupport.backend_available?
|
|
24
|
+
Spree::Auth::Engine.prepare_frontend if SolidusSupport.frontend_available?
|
|
23
25
|
|
|
24
|
-
ApplicationController.
|
|
26
|
+
ApplicationController.include Spree::AuthenticationHelpers
|
|
25
27
|
end
|
|
26
28
|
|
|
27
|
-
def self.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
def self.redirect_back_on_unauthorized?
|
|
30
|
+
return false unless Spree::Config.respond_to?(:redirect_back_on_unauthorized)
|
|
31
|
+
|
|
32
|
+
if Spree::Config.redirect_back_on_unauthorized
|
|
33
|
+
true
|
|
34
|
+
else
|
|
35
|
+
Spree::Deprecation.warn <<-WARN.strip_heredoc, caller
|
|
36
|
+
Having Spree::Config.redirect_back_on_unauthorized set
|
|
37
|
+
to `false` is deprecated and will not be supported in Solidus 3.0.
|
|
38
|
+
Please change this configuration to `true` and be sure that your
|
|
39
|
+
application does not break trying to redirect back when there is
|
|
40
|
+
an unauthorized access.
|
|
41
|
+
WARN
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
Rails.configuration.cache_classes ? require(c) : load(c)
|
|
43
|
+
false
|
|
35
44
|
end
|
|
45
|
+
end
|
|
36
46
|
|
|
47
|
+
def self.prepare_backend
|
|
37
48
|
Spree::Admin::BaseController.unauthorized_redirect = -> do
|
|
38
49
|
if try_spree_current_user
|
|
39
|
-
flash[:error] =
|
|
40
|
-
|
|
50
|
+
flash[:error] = I18n.t('spree.authorization_failure')
|
|
51
|
+
|
|
52
|
+
if Spree::Auth::Engine.redirect_back_on_unauthorized?
|
|
53
|
+
redirect_back(fallback_location: spree.admin_unauthorized_path)
|
|
54
|
+
else
|
|
55
|
+
redirect_to spree.admin_unauthorized_path
|
|
56
|
+
end
|
|
41
57
|
else
|
|
42
58
|
store_location
|
|
43
|
-
|
|
59
|
+
|
|
60
|
+
if Spree::Auth::Engine.redirect_back_on_unauthorized?
|
|
61
|
+
redirect_back(fallback_location: spree.admin_login_path)
|
|
62
|
+
else
|
|
63
|
+
redirect_to spree.admin_login_path
|
|
64
|
+
end
|
|
44
65
|
end
|
|
45
66
|
end
|
|
46
67
|
end
|
|
47
68
|
|
|
48
|
-
def self.prepare_frontend
|
|
49
|
-
Rails.application.config.assets.precompile += %w[
|
|
50
|
-
lib/assets/javascripts/spree/frontend/solidus_auth.js
|
|
51
|
-
lib/assets/javascripts/spree/frontend/solidus_auth.css
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/frontend/*/*_decorator*.rb")) do |c|
|
|
55
|
-
Rails.configuration.cache_classes ? require(c) : load(c)
|
|
56
|
-
end
|
|
57
69
|
|
|
70
|
+
def self.prepare_frontend
|
|
58
71
|
Spree::BaseController.unauthorized_redirect = -> do
|
|
59
72
|
if try_spree_current_user
|
|
60
|
-
flash[:error] =
|
|
61
|
-
|
|
73
|
+
flash[:error] = I18n.t('spree.authorization_failure')
|
|
74
|
+
|
|
75
|
+
if Spree::Auth::Engine.redirect_back_on_unauthorized?
|
|
76
|
+
redirect_back(fallback_location: spree.unauthorized_path)
|
|
77
|
+
else
|
|
78
|
+
redirect_to spree.unauthorized_path
|
|
79
|
+
end
|
|
62
80
|
else
|
|
63
81
|
store_location
|
|
64
|
-
|
|
82
|
+
|
|
83
|
+
if Spree::Auth::Engine.redirect_back_on_unauthorized?
|
|
84
|
+
redirect_back(fallback_location: spree.login_path)
|
|
85
|
+
else
|
|
86
|
+
redirect_to spree.login_path
|
|
87
|
+
end
|
|
65
88
|
end
|
|
66
89
|
end
|
|
67
90
|
end
|
|
68
|
-
|
|
69
|
-
if SolidusSupport.backend_available?
|
|
70
|
-
paths["app/controllers"] << "lib/controllers/backend"
|
|
71
|
-
paths["app/views"] << "lib/views/backend"
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
if SolidusSupport.frontend_available?
|
|
75
|
-
paths["app/controllers"] << "lib/controllers/frontend"
|
|
76
|
-
paths["app/views"] << "lib/views/frontend"
|
|
77
|
-
end
|
|
78
91
|
end
|
|
79
92
|
end
|
|
80
93
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Spree
|
|
2
4
|
module AuthenticationHelpers
|
|
3
5
|
def self.included(receiver)
|
|
@@ -17,17 +19,9 @@ module Spree
|
|
|
17
19
|
end
|
|
18
20
|
|
|
19
21
|
if SolidusSupport.frontend_available?
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def spree_signup_path
|
|
25
|
-
spree.signup_path
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def spree_logout_path
|
|
29
|
-
spree.logout_path
|
|
30
|
-
end
|
|
22
|
+
delegate :login_path, :signup_path, :logout_path,
|
|
23
|
+
to: :spree,
|
|
24
|
+
prefix: :spree
|
|
31
25
|
end
|
|
32
26
|
end
|
|
33
27
|
end
|
data/lib/tasks/auth.rake
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
namespace :spree_auth do
|
|
2
4
|
namespace :admin do
|
|
3
5
|
desc "Create admin username and password"
|
|
4
|
-
task :
|
|
6
|
+
task create: :environment do
|
|
5
7
|
require File.join(File.dirname(__FILE__), '..', '..', 'db', 'default', 'users.rb')
|
|
6
8
|
puts "Done!"
|
|
7
9
|
end
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<% if spree_current_user %>
|
|
2
2
|
<ul id="login-nav" class="admin-login-nav">
|
|
3
3
|
<li data-hook="user-account-link">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
<% if can?(:admin, try_spree_current_user) %>
|
|
5
|
+
<%= link_to spree.edit_admin_user_path(try_spree_current_user) do %>
|
|
6
|
+
<i class='fa fa-user'></i>
|
|
7
|
+
<%= try_spree_current_user.email %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% else %>
|
|
10
|
+
<a>
|
|
11
|
+
<i class='fa fa-user'></i>
|
|
12
|
+
<%= try_spree_current_user.email %>
|
|
13
|
+
</a>
|
|
7
14
|
<% end %>
|
|
8
15
|
</li>
|
|
9
16
|
<li data-hook="user-logout-link">
|
|
10
|
-
<%= link_to spree.admin_logout_path do %>
|
|
17
|
+
<%= link_to spree.admin_logout_path, method: Devise.sign_out_via do %>
|
|
11
18
|
<i class='fa fa-sign-out'></i>
|
|
12
|
-
<%=
|
|
19
|
+
<%= I18n.t('spree.logout') %>
|
|
13
20
|
<% end %>
|
|
14
21
|
</li>
|
|
15
22
|
|
|
@@ -17,7 +24,7 @@
|
|
|
17
24
|
<li data-hook="store-frontend-link">
|
|
18
25
|
<%= link_to spree.root_path, target: '_blank' do %>
|
|
19
26
|
<i class='fa fa-external-link'></i>
|
|
20
|
-
<%=
|
|
27
|
+
<%= I18n.t('spree.back_to_store') %>
|
|
21
28
|
<% end %>
|
|
22
29
|
</li>
|
|
23
30
|
<% end %>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
|
2
|
-
<h2><%=
|
|
2
|
+
<h2><%= I18n.t('spree.change_my_password') %></h2>
|
|
3
3
|
|
|
4
4
|
<%= form_for @spree_user, as: :spree_user, url: spree.update_password_path, method: :put do |f| %>
|
|
5
5
|
<p>
|
|
6
|
-
<%= f.label :password,
|
|
6
|
+
<%= f.label :password, I18n.t('spree.password') %><br />
|
|
7
7
|
<%= f.password_field :password %><br />
|
|
8
8
|
</p>
|
|
9
9
|
<p>
|
|
10
|
-
<%= f.label :password_confirmation,
|
|
10
|
+
<%= f.label :password_confirmation, I18n.t('spree.confirm_password') %><br />
|
|
11
11
|
<%= f.password_field :password_confirmation %><br />
|
|
12
12
|
</p>
|
|
13
13
|
<%= f.hidden_field :reset_password_token %>
|
|
14
|
-
<%= f.submit
|
|
14
|
+
<%= f.submit I18n.t('spree.update'), class: 'button primary' %>
|
|
15
15
|
<% end %>
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
|
2
|
-
|
|
3
1
|
<div id="forgot-password">
|
|
4
|
-
<h6><%=
|
|
2
|
+
<h6><%= I18n.t('spree.forgot_password') %></h6>
|
|
5
3
|
|
|
6
|
-
<p><%=
|
|
4
|
+
<p><%= I18n.t('spree.instructions_to_reset_password') %></p>
|
|
7
5
|
|
|
8
|
-
<%= form_for Spree::User.new, as: :spree_user, url: spree.
|
|
6
|
+
<%= form_for Spree::User.new, as: :spree_user, url: spree.admin_reset_password_path do |f| %>
|
|
9
7
|
<p>
|
|
10
|
-
<%= f.label :email,
|
|
11
|
-
<%= f.email_field :email %>
|
|
8
|
+
<%= f.label :email, I18n.t('spree.email') %><br />
|
|
9
|
+
<%= f.email_field :email, required: true %>
|
|
12
10
|
</p>
|
|
13
11
|
<p>
|
|
14
|
-
<%= f.submit
|
|
12
|
+
<%= f.submit I18n.t('spree.reset_password'), class: 'button primary' %>
|
|
15
13
|
</p>
|
|
16
14
|
<% end %>
|
|
17
15
|
</div>
|
|
@@ -4,28 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
<% @body_id = 'login' %>
|
|
6
6
|
<div id="existing-customer">
|
|
7
|
-
<h6><%=
|
|
7
|
+
<h6><%= I18n.t('spree.admin_login') %></h6>
|
|
8
8
|
<div data-hook="login">
|
|
9
9
|
<%= form_for Spree::User.new, as: :spree_user, url: spree.admin_create_new_session_path do |f| %>
|
|
10
10
|
<div id="password-credentials">
|
|
11
11
|
<p>
|
|
12
|
-
<%= f.label :email,
|
|
13
|
-
<%= f.email_field :email, class: 'title', tabindex: 1 %>
|
|
12
|
+
<%= f.label :email, I18n.t('spree.email') %><br />
|
|
13
|
+
<%= f.email_field :email, class: 'title', tabindex: 1, autocomplete: 'username' %>
|
|
14
14
|
</p>
|
|
15
15
|
<p>
|
|
16
|
-
<%= f.label :password,
|
|
17
|
-
<%= f.password_field :password, class: 'title', tabindex: 2 %>
|
|
16
|
+
<%= f.label :password, I18n.t('spree.password') %><br />
|
|
17
|
+
<%= f.password_field :password, class: 'title', tabindex: 2, autocomplete: 'current-password' %>
|
|
18
18
|
</p>
|
|
19
19
|
</div>
|
|
20
20
|
<p>
|
|
21
21
|
<%= f.check_box :remember_me, tabindex: 3 %>
|
|
22
|
-
<%= f.label :remember_me,
|
|
22
|
+
<%= f.label :remember_me, I18n.t('spree.remember_me') %>
|
|
23
23
|
</p>
|
|
24
24
|
|
|
25
|
-
<p><%= f.submit
|
|
25
|
+
<p><%= f.submit I18n.t('spree.login'), class: 'btn btn-primary', tabindex: 4 %></p>
|
|
26
26
|
<% end %>
|
|
27
|
-
<%=
|
|
28
|
-
<%= link_to
|
|
27
|
+
<%= I18n.t('spree.or') %>
|
|
28
|
+
<%= link_to I18n.t('spree.forgot_password'), spree.admin_recover_password_path %>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
<div data-hook="login_extras"></div>
|