solidus_auth_devise_devise_token_auth 2.1.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 +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +20 -0
- data/CHANGELOG.md +173 -0
- data/Gemfile +36 -0
- data/LICENSE.md +26 -0
- data/README.md +98 -0
- data/Rakefile +21 -0
- data/app/mailers/spree/user_mailer.rb +15 -0
- data/app/models/spree/auth_configuration.rb +9 -0
- data/app/models/spree/user.rb +47 -0
- data/app/overrides/auth_admin_login_navigation_bar.rb +10 -0
- data/app/overrides/auth_shared_login_bar.rb +10 -0
- data/bin/rails +7 -0
- data/circle.yml +6 -0
- data/config/initializers/devise.rb +141 -0
- data/config/initializers/warden.rb +14 -0
- data/config/locales/de.yml +53 -0
- data/config/locales/en.yml +54 -0
- data/config/locales/es.yml +50 -0
- data/config/locales/fr.yml +50 -0
- data/config/locales/it.yml +76 -0
- data/config/locales/nl.yml +50 -0
- data/config/locales/pt-BR.yml +52 -0
- data/config/locales/tr.yml +50 -0
- data/config/locales/zh-CN.yml +54 -0
- data/config/routes.rb +71 -0
- data/db/default/users.rb +75 -0
- data/db/migrate/20101026184949_create_users.rb +29 -0
- data/db/migrate/20101026184950_rename_columns_for_devise.rb +41 -0
- data/db/migrate/20101214150824_convert_user_remember_field.rb +11 -0
- data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +8 -0
- data/db/migrate/20120605211305_make_users_email_index_unique.rb +9 -0
- data/db/migrate/20140904000425_add_deleted_at_to_users.rb +6 -0
- data/db/migrate/20141002154641_add_confirmable_to_users.rb +7 -0
- data/db/seeds.rb +1 -0
- data/lib/assets/javascripts/spree/backend/solidus_auth.js +1 -0
- data/lib/assets/javascripts/spree/frontend/solidus_auth.js +1 -0
- data/lib/assets/stylesheets/spree/backend/solidus_auth.css +3 -0
- data/lib/assets/stylesheets/spree/frontend/solidus_auth.css +3 -0
- data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +11 -0
- data/lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb +15 -0
- data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +41 -0
- data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +43 -0
- data/lib/controllers/frontend/spree/checkout_controller_decorator.rb +66 -0
- data/lib/controllers/frontend/spree/user_confirmations_controller.rb +14 -0
- data/lib/controllers/frontend/spree/user_passwords_controller.rb +50 -0
- data/lib/controllers/frontend/spree/user_registrations_controller.rb +40 -0
- data/lib/controllers/frontend/spree/user_sessions_controller.rb +64 -0
- data/lib/controllers/frontend/spree/users_controller.rb +57 -0
- data/lib/generators/solidus/auth/install/install_generator.rb +25 -0
- data/lib/generators/solidus/auth/install/templates/config/initializers/devise.rb +1 -0
- data/lib/solidus/auth.rb +2 -0
- data/lib/solidus_auth_devise.rb +13 -0
- data/lib/spree/auth/devise.rb +14 -0
- data/lib/spree/auth/engine.rb +80 -0
- data/lib/spree/authentication_helpers.rb +33 -0
- data/lib/tasks/auth.rake +9 -0
- data/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb +25 -0
- data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +15 -0
- data/lib/views/backend/spree/admin/user_passwords/new.html.erb +17 -0
- data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +4 -0
- data/lib/views/backend/spree/admin/user_sessions/new.html.erb +31 -0
- data/lib/views/backend/spree/layouts/admin/_login_nav.html.erb +13 -0
- data/lib/views/frontend/spree/checkout/registration.html.erb +22 -0
- data/lib/views/frontend/spree/shared/_flashes.html.erb +9 -0
- data/lib/views/frontend/spree/shared/_login.html.erb +18 -0
- data/lib/views/frontend/spree/shared/_login_bar.html.erb +2 -0
- data/lib/views/frontend/spree/shared/_login_bar_items.html.erb +6 -0
- data/lib/views/frontend/spree/shared/_user_form.html.erb +17 -0
- data/lib/views/frontend/spree/user_mailer/confirmation_instructions.text.erb +5 -0
- data/lib/views/frontend/spree/user_mailer/reset_password_instructions.text.erb +10 -0
- data/lib/views/frontend/spree/user_passwords/edit.html.erb +17 -0
- data/lib/views/frontend/spree/user_passwords/new.html.erb +17 -0
- data/lib/views/frontend/spree/user_registrations/new.html.erb +21 -0
- data/lib/views/frontend/spree/user_sessions/authorization_failure.html.erb +4 -0
- data/lib/views/frontend/spree/user_sessions/new.html.erb +13 -0
- data/lib/views/frontend/spree/users/edit.html.erb +14 -0
- data/lib/views/frontend/spree/users/show.html.erb +43 -0
- data/solidus_auth_devise.gemspec +41 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +196 -0
- data/spec/controllers/spree/products_controller_spec.rb +27 -0
- data/spec/controllers/spree/user_passwords_controller_spec.rb +44 -0
- data/spec/controllers/spree/user_registrations_controller_spec.rb +96 -0
- data/spec/controllers/spree/user_sessions_controller_spec.rb +113 -0
- data/spec/controllers/spree/users_controller_spec.rb +38 -0
- data/spec/factories/confirmed_user.rb +7 -0
- data/spec/features/account_spec.rb +58 -0
- data/spec/features/admin/orders_spec.rb +30 -0
- data/spec/features/admin/password_reset_spec.rb +24 -0
- data/spec/features/admin/products_spec.rb +9 -0
- data/spec/features/admin/sign_in_spec.rb +44 -0
- data/spec/features/admin/sign_out_spec.rb +22 -0
- data/spec/features/admin_permissions_spec.rb +46 -0
- data/spec/features/change_email_spec.rb +26 -0
- data/spec/features/checkout_spec.rb +181 -0
- data/spec/features/confirmation_spec.rb +32 -0
- data/spec/features/order_spec.rb +62 -0
- data/spec/features/password_reset_spec.rb +24 -0
- data/spec/features/sign_in_spec.rb +52 -0
- data/spec/features/sign_out_spec.rb +25 -0
- data/spec/features/sign_up_spec.rb +30 -0
- data/spec/mailers/user_mailer_spec.rb +46 -0
- data/spec/models/order_spec.rb +26 -0
- data/spec/models/user_spec.rb +63 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/support/ability.rb +15 -0
- data/spec/support/authentication_helpers.rb +14 -0
- data/spec/support/confirm_helpers.rb +13 -0
- data/spec/support/email.rb +5 -0
- data/spec/support/preferences.rb +5 -0
- data/spec/support/spree.rb +10 -0
- metadata +446 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module Solidus
|
|
2
|
+
module Auth
|
|
3
|
+
module Generators
|
|
4
|
+
class InstallGenerator < Rails::Generators::Base
|
|
5
|
+
def self.source_paths
|
|
6
|
+
paths = self.superclass.source_paths
|
|
7
|
+
paths << File.expand_path('../templates', __FILE__)
|
|
8
|
+
paths.flatten
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def generate_devise_key
|
|
12
|
+
template 'config/initializers/devise.rb', 'config/initializers/devise.rb', skip: true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def add_migrations
|
|
16
|
+
run 'bundle exec rake railties:install:migrations FROM=solidus_auth_devise'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def run_migrations
|
|
20
|
+
run 'bundle exec rake db:migrate'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Devise.secret_key = <%= SecureRandom.hex(50).inspect %>
|
data/lib/solidus/auth.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require "spree_core"
|
|
2
|
+
require "solidus_support"
|
|
3
|
+
require "spree/auth/devise"
|
|
4
|
+
require "spree/authentication_helpers"
|
|
5
|
+
|
|
6
|
+
if SolidusSupport.solidus_gem_version < Gem::Version.new('2.5.x')
|
|
7
|
+
begin
|
|
8
|
+
require "deface"
|
|
9
|
+
rescue LoadError
|
|
10
|
+
warn "deface is required to run solidus_auth_devise with solidus versions < 2.5. Please add deface to your Gemfile"
|
|
11
|
+
raise
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
require 'devise'
|
|
2
|
+
require 'devise-encryptable'
|
|
3
|
+
|
|
4
|
+
module Spree
|
|
5
|
+
module Auth
|
|
6
|
+
class Engine < Rails::Engine
|
|
7
|
+
isolate_namespace Spree
|
|
8
|
+
engine_name 'solidus_auth'
|
|
9
|
+
|
|
10
|
+
initializer "spree.auth.environment", before: :load_config_initializers do |app|
|
|
11
|
+
Spree::Auth::Config = Spree::AuthConfiguration.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
initializer "solidus_auth_devise.set_user_class", after: :load_config_initializers do
|
|
15
|
+
Spree.user_class = "Spree::User"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
config.to_prepare do
|
|
19
|
+
auth = Spree::Auth::Engine
|
|
20
|
+
|
|
21
|
+
auth.prepare_backend if SolidusSupport.backend_available?
|
|
22
|
+
auth.prepare_frontend if SolidusSupport.frontend_available?
|
|
23
|
+
|
|
24
|
+
ApplicationController.send :include, Spree::AuthenticationHelpers
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.prepare_backend
|
|
28
|
+
Rails.application.config.assets.precompile += %w[
|
|
29
|
+
lib/assets/javascripts/spree/backend/solidus_auth.js
|
|
30
|
+
lib/assets/javascripts/spree/backend/solidus_auth.css
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/backend/*/*/*_decorator*.rb")) do |c|
|
|
34
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Spree::Admin::BaseController.unauthorized_redirect = -> do
|
|
38
|
+
if try_spree_current_user
|
|
39
|
+
flash[:error] = Spree.t(:authorization_failure)
|
|
40
|
+
redirect_to spree.admin_unauthorized_path
|
|
41
|
+
else
|
|
42
|
+
store_location
|
|
43
|
+
redirect_to spree.admin_login_path
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
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
|
+
|
|
58
|
+
Spree::BaseController.unauthorized_redirect = -> do
|
|
59
|
+
if try_spree_current_user
|
|
60
|
+
flash[:error] = Spree.t(:authorization_failure)
|
|
61
|
+
redirect_to spree.unauthorized_path
|
|
62
|
+
else
|
|
63
|
+
store_location
|
|
64
|
+
redirect_to spree.login_path
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
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
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Spree
|
|
2
|
+
module AuthenticationHelpers
|
|
3
|
+
def self.included(receiver)
|
|
4
|
+
if receiver.send(:respond_to?, :helper_method)
|
|
5
|
+
receiver.send(:helper_method, :spree_current_user)
|
|
6
|
+
|
|
7
|
+
if SolidusSupport.frontend_available?
|
|
8
|
+
receiver.send(:helper_method, :spree_login_path)
|
|
9
|
+
receiver.send(:helper_method, :spree_signup_path)
|
|
10
|
+
receiver.send(:helper_method, :spree_logout_path)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def spree_current_user
|
|
16
|
+
current_spree_user
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
if SolidusSupport.frontend_available?
|
|
20
|
+
def spree_login_path
|
|
21
|
+
spree.login_path
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def spree_signup_path
|
|
25
|
+
spree.signup_path
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def spree_logout_path
|
|
29
|
+
spree.logout_path
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/lib/tasks/auth.rake
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<% if spree_current_user %>
|
|
2
|
+
<ul id="login-nav" class="admin-login-nav">
|
|
3
|
+
<li data-hook="user-account-link">
|
|
4
|
+
<%= link_to spree.edit_admin_user_path(spree_current_user) do %>
|
|
5
|
+
<i class='fa fa-user'></i>
|
|
6
|
+
<%= spree_current_user.email %>
|
|
7
|
+
<% end %>
|
|
8
|
+
</li>
|
|
9
|
+
<li data-hook="user-logout-link">
|
|
10
|
+
<%= link_to spree.admin_logout_path do %>
|
|
11
|
+
<i class='fa fa-sign-out'></i>
|
|
12
|
+
<%= Spree.t(:logout) %>
|
|
13
|
+
<% end %>
|
|
14
|
+
</li>
|
|
15
|
+
|
|
16
|
+
<% if spree.respond_to? :root_path %>
|
|
17
|
+
<li data-hook="store-frontend-link">
|
|
18
|
+
<%= link_to spree.root_path, target: '_blank' do %>
|
|
19
|
+
<i class='fa fa-external-link'></i>
|
|
20
|
+
<%= Spree.t(:back_to_store) %>
|
|
21
|
+
<% end %>
|
|
22
|
+
</li>
|
|
23
|
+
<% end %>
|
|
24
|
+
</ul>
|
|
25
|
+
<% end %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
|
2
|
+
<h2><%= Spree.t(:change_my_password) %></h2>
|
|
3
|
+
|
|
4
|
+
<%= form_for @spree_user, as: :spree_user, url: spree.update_password_path, method: :put do |f| %>
|
|
5
|
+
<p>
|
|
6
|
+
<%= f.label :password, Spree.t(:password) %><br />
|
|
7
|
+
<%= f.password_field :password %><br />
|
|
8
|
+
</p>
|
|
9
|
+
<p>
|
|
10
|
+
<%= f.label :password_confirmation, Spree.t(:confirm_password) %><br />
|
|
11
|
+
<%= f.password_field :password_confirmation %><br />
|
|
12
|
+
</p>
|
|
13
|
+
<%= f.hidden_field :reset_password_token %>
|
|
14
|
+
<%= f.submit Spree.t(:update), class: 'button primary' %>
|
|
15
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
|
2
|
+
|
|
3
|
+
<div id="forgot-password">
|
|
4
|
+
<h6><%= Spree.t(:forgot_password) %></h6>
|
|
5
|
+
|
|
6
|
+
<p><%= Spree.t(:instructions_to_reset_password) %></p>
|
|
7
|
+
|
|
8
|
+
<%= form_for Spree::User.new, as: :spree_user, url: spree.admin_reset_password_path do |f| %>
|
|
9
|
+
<p>
|
|
10
|
+
<%= f.label :email, Spree.t(:email) %><br />
|
|
11
|
+
<%= f.email_field :email %>
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<%= f.submit Spree.t(:reset_password), class: 'button primary' %>
|
|
15
|
+
</p>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<% if flash[:alert] %>
|
|
2
|
+
<div class="flash errors"><%= flash[:alert] %></div>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<% @body_id = 'login' %>
|
|
6
|
+
<div id="existing-customer">
|
|
7
|
+
<h6><%= Spree.t(:admin_login) %></h6>
|
|
8
|
+
<div data-hook="login">
|
|
9
|
+
<%= form_for Spree::User.new, as: :spree_user, url: spree.admin_create_new_session_path do |f| %>
|
|
10
|
+
<div id="password-credentials">
|
|
11
|
+
<p>
|
|
12
|
+
<%= f.label :email, Spree.t(:email) %><br />
|
|
13
|
+
<%= f.email_field :email, class: 'title', tabindex: 1 %>
|
|
14
|
+
</p>
|
|
15
|
+
<p>
|
|
16
|
+
<%= f.label :password, Spree.t(:password) %><br />
|
|
17
|
+
<%= f.password_field :password, class: 'title', tabindex: 2 %>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<p>
|
|
21
|
+
<%= f.check_box :remember_me, tabindex: 3 %>
|
|
22
|
+
<%= f.label :remember_me, Spree.t(:remember_me) %>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p><%= f.submit Spree.t(:login), class: 'button primary', tabindex: 4 %></p>
|
|
26
|
+
<% end %>
|
|
27
|
+
<%= Spree.t(:or) %>
|
|
28
|
+
<%= link_to Spree.t(:forgot_password), spree.admin_recover_password_path %>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div data-hook="login_extras"></div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<% if spree_current_user %>
|
|
2
|
+
<ul id="login-nav" class="inline-menu">
|
|
3
|
+
<li data-hook="user-logged-in-as"><%= Spree.t(:logged_in_as) %>: <%= spree_current_user.email %></li>
|
|
4
|
+
<li data-hook="user-account-link" class='fa fa-user'><%= link_to Spree.t(:account), spree.edit_admin_user_path(spree_current_user) %></li>
|
|
5
|
+
<li data-hook="user-logout-link" class='fa fa-sign-out'><%= link_to Spree.t(:logout), spree.admin_logout_path %></li>
|
|
6
|
+
|
|
7
|
+
<% if spree.respond_to? :root_path %>
|
|
8
|
+
<li data-hook="store-frontend-link" class='fa fa-external-link'>
|
|
9
|
+
<%= link_to Spree.t(:back_to_store), spree.root_path, target: '_blank' %>
|
|
10
|
+
</li>
|
|
11
|
+
<% end %>
|
|
12
|
+
</ul>
|
|
13
|
+
<% end %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @user } %>
|
|
2
|
+
<h1><%= Spree.t(:registration) %></h1>
|
|
3
|
+
<div id="registration" data-hook>
|
|
4
|
+
<div id="account" class="columns alpha eight">
|
|
5
|
+
<%= render template: 'spree/user_sessions/new' %>
|
|
6
|
+
</div>
|
|
7
|
+
<% if Spree::Config[:allow_guest_checkout] %>
|
|
8
|
+
<div id="guest_checkout" data-hook class="columns omega eight">
|
|
9
|
+
<h6><%= Spree.t(:guest_user_account) %></h6>
|
|
10
|
+
<% if flash[:registration_error] %>
|
|
11
|
+
<div class='flash error'><%= flash[:registration_error] %></div>
|
|
12
|
+
<% end %>
|
|
13
|
+
<%= form_for @order, url: update_checkout_registration_path, method: :put, html: { id: 'checkout_form_registration' } do |f| %>
|
|
14
|
+
<p>
|
|
15
|
+
<%= f.label :email, Spree.t(:email) %><br />
|
|
16
|
+
<%= f.email_field :email, class: 'title' %>
|
|
17
|
+
</p>
|
|
18
|
+
<p><%= f.submit Spree.t(:continue), class: 'button primary' %></p>
|
|
19
|
+
<% end %>
|
|
20
|
+
</div>
|
|
21
|
+
<% end %>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<%= form_for Spree::User.new, as: :spree_user, url: spree.create_new_session_path do |f| %>
|
|
2
|
+
<div id="password-credentials">
|
|
3
|
+
<p>
|
|
4
|
+
<%= f.label :email, Spree.t(:email) %><br />
|
|
5
|
+
<%= f.email_field :email, class: 'title', tabindex: 1, autofocus: true %>
|
|
6
|
+
</p>
|
|
7
|
+
<p>
|
|
8
|
+
<%= f.label :password, Spree.t(:password) %><br />
|
|
9
|
+
<%= f.password_field :password, class: 'title', tabindex: 2 %>
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
<p>
|
|
13
|
+
<%= f.check_box :remember_me, tabindex: 3 %>
|
|
14
|
+
<%= f.label :remember_me, Spree.t(:remember_me) %>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p><%= f.submit Spree.t(:login), class: 'button primary', tabindex: 4 %></p>
|
|
18
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<%= f.label :email, Spree.t(:email) %><br />
|
|
3
|
+
<%= f.email_field :email, class: 'title' %>
|
|
4
|
+
</p>
|
|
5
|
+
<div id="password-credentials">
|
|
6
|
+
<p>
|
|
7
|
+
<%= f.label :password, Spree.t(:password) %><br />
|
|
8
|
+
<%= f.password_field :password, class: 'title' %>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<%= f.label :password_confirmation, Spree.t(:confirm_password) %><br />
|
|
13
|
+
<%= f.password_field :password_confirmation, class: 'title' %>
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div data-hook="signup_below_password_fields"></div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
A request to reset your password has been made.
|
|
2
|
+
If you did not make this request, simply ignore this email.
|
|
3
|
+
|
|
4
|
+
If you did make this request just click the link below:
|
|
5
|
+
|
|
6
|
+
<%= @edit_password_reset_url %>
|
|
7
|
+
|
|
8
|
+
If the above URL does not work try copying and pasting it into your browser.
|
|
9
|
+
If you continue to have problems please feel free to contact us.
|
|
10
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
|
2
|
+
<div id="change-password">
|
|
3
|
+
<h6><%= Spree.t(:change_my_password) %></h6>
|
|
4
|
+
|
|
5
|
+
<%= form_for @spree_user, as: :spree_user, url: spree.update_password_path, method: :put do |f| %>
|
|
6
|
+
<p>
|
|
7
|
+
<%= f.label :password, Spree.t(:password) %><br />
|
|
8
|
+
<%= f.password_field :password %><br />
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<%= f.label :password_confirmation, Spree.t(:confirm_password) %><br />
|
|
12
|
+
<%= f.password_field :password_confirmation %><br />
|
|
13
|
+
</p>
|
|
14
|
+
<%= f.hidden_field :reset_password_token %>
|
|
15
|
+
<%= f.submit Spree.t(:update), class: 'button primary' %>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
|
2
|
+
|
|
3
|
+
<div id="forgot-password">
|
|
4
|
+
<h6><%= Spree.t(:forgot_password) %></h6>
|
|
5
|
+
|
|
6
|
+
<p><%= Spree.t(:instructions_to_reset_password) %></p>
|
|
7
|
+
|
|
8
|
+
<%= form_for Spree::User.new, as: :spree_user, url: spree.reset_password_path do |f| %>
|
|
9
|
+
<p>
|
|
10
|
+
<%= f.label :email, Spree.t(:email) %><br />
|
|
11
|
+
<%= f.email_field :email %>
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<%= f.submit Spree.t(:reset_password), class: 'button primary' %>
|
|
15
|
+
</p>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|