spree_auth_devise 3.2.0.beta → 3.2.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.
Potentially problematic release.
This version of spree_auth_devise might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +17 -6
- data/.travis.yml +19 -7
- data/Appraisals +13 -0
- data/CHANGELOG.md +11 -3
- data/Gemfile +1 -0
- data/README.md +30 -27
- data/Rakefile +1 -1
- data/app/mailers/spree/user_mailer.rb +6 -6
- data/app/models/spree/auth_configuration.rb +3 -3
- data/app/models/spree/user.rb +17 -16
- data/app/overrides/auth_shared_login_bar.rb +6 -7
- data/config.ru +1 -1
- data/config/initializers/devise.rb +1 -1
- data/config/initializers/warden.rb +2 -2
- data/config/locales/bg.yml +54 -0
- data/config/locales/de.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/es.yml +1 -1
- data/config/locales/fr.yml +1 -1
- data/config/locales/it.yml +2 -2
- data/config/locales/nl.yml +1 -1
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/pt.yml +1 -1
- data/config/locales/tr.yml +1 -1
- data/config/routes.rb +17 -18
- data/db/default/users.rb +6 -6
- data/db/migrate/20101026184949_create_users.rb +14 -9
- data/db/migrate/20101026184950_rename_columns_for_devise.rb +6 -1
- data/db/migrate/20101214150824_convert_user_remember_field.rb +6 -1
- data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +6 -1
- data/db/migrate/20120605211305_make_users_email_index_unique.rb +8 -3
- data/db/migrate/20140904000425_add_deleted_at_to_users.rb +6 -1
- data/db/migrate/20141002154641_add_confirmable_to_users.rb +6 -1
- data/db/migrate/20150416152553_add_missing_indices_on_user.rb +6 -1
- data/gemfiles/spree_3_1.gemfile +7 -0
- data/gemfiles/spree_3_2.gemfile +8 -0
- data/gemfiles/spree_master.gemfile +8 -0
- data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +6 -8
- data/lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb +15 -14
- data/lib/controllers/backend/spree/admin/admin_resource_controller_decorator.rb +1 -1
- data/lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb +9 -8
- data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +6 -1
- data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +22 -16
- data/lib/controllers/frontend/spree/checkout_controller_decorator.rb +17 -16
- data/lib/controllers/frontend/spree/user_confirmations_controller.rb +4 -0
- data/lib/controllers/frontend/spree/user_passwords_controller.rb +5 -1
- data/lib/controllers/frontend/spree/user_registrations_controller.rb +4 -0
- data/lib/controllers/frontend/spree/user_sessions_controller.rb +18 -11
- data/lib/controllers/frontend/spree/users_controller.rb +16 -15
- data/lib/generators/spree/auth/install/install_generator.rb +8 -2
- data/lib/spree/auth/devise.rb +1 -1
- data/lib/spree/auth/engine.rb +9 -9
- data/lib/tasks/auth.rake +1 -1
- data/lib/views/frontend/spree/users/show.html.erb +1 -1
- data/spec/controllers/spree/checkout_controller_spec.rb +1 -2
- data/spec/controllers/spree/products_controller_spec.rb +0 -1
- data/spec/controllers/spree/user_passwords_controller_spec.rb +3 -4
- data/spec/controllers/spree/user_registrations_controller_spec.rb +0 -1
- data/spec/controllers/spree/user_sessions_controller_spec.rb +0 -1
- data/spec/controllers/spree/users_controller_spec.rb +0 -1
- data/spec/factories/confirmed_user.rb +1 -1
- data/spec/features/account_spec.rb +0 -1
- data/spec/features/admin/orders_spec.rb +0 -1
- data/spec/features/admin/password_reset_spec.rb +0 -1
- data/spec/features/admin/products_spec.rb +0 -1
- data/spec/features/admin/sign_in_spec.rb +0 -1
- data/spec/features/admin/sign_out_spec.rb +0 -1
- data/spec/features/admin_permissions_spec.rb +0 -1
- data/spec/features/change_email_spec.rb +0 -1
- data/spec/features/checkout_spec.rb +8 -8
- data/spec/features/confirmation_spec.rb +1 -1
- data/spec/features/order_spec.rb +0 -1
- data/spec/features/password_reset_spec.rb +0 -1
- data/spec/features/sign_in_spec.rb +1 -2
- data/spec/features/sign_out_spec.rb +0 -1
- data/spec/features/sign_up_spec.rb +0 -1
- data/spec/mailers/user_mailer_spec.rb +0 -1
- data/spec/models/order_spec.rb +0 -1
- data/spec/models/user_spec.rb +3 -1
- data/spec/spec_helper.rb +0 -7
- data/spec/support/ability.rb +1 -1
- data/spec/support/authentication_helpers.rb +2 -2
- data/spec/support/capybara.rb +1 -1
- data/spec/support/confirm_helpers.rb +1 -1
- data/spec/support/database_cleaner.rb +2 -3
- data/spec/support/spree.rb +0 -16
- data/spree_auth_devise.gemspec +6 -6
- metadata +16 -13
- data/Versionfile +0 -5
- data/circle.yml +0 -13
data/config/locales/it.yml
CHANGED
@@ -29,7 +29,7 @@ it:
|
|
29
29
|
omniauth_callbacks:
|
30
30
|
failure: Non è stato possibile autorizzarti da %{kind} perché "%{reason}".
|
31
31
|
success: Autorizzato con successo dall'account %{kind}.
|
32
|
-
|
32
|
+
user_passwords:
|
33
33
|
no_token: Puoi accedere a questa pagina solamente dalla email di reset della password. Se vieni dalla email controlla di aver inserito l'url completo riportato nella email.
|
34
34
|
send_instructions: Riceverai un messaggio email con le istruzioni per reimpostare la tua password entro qualche minuto.
|
35
35
|
send_paranoid_instructions: Se la tua e-mail esiste nel nostro database, riceverai un messaggio email contentente un link per il ripristino della password
|
@@ -50,7 +50,7 @@ it:
|
|
50
50
|
send_instructions: Riceverai un messaggio email con le istruzioni per sbloccare il tuo account entro qualche minuto.
|
51
51
|
send_paranoid_instructions: Se la tua e-mail esiste nel nostro database, riceverai un messaggio email con le istruzioni per sbloccare il tuo account entro qualche minuto.
|
52
52
|
unlocked: Il tuo account è stato correttamente sbloccato. Ora sei collegato.
|
53
|
-
|
53
|
+
user_passwords:
|
54
54
|
spree_user:
|
55
55
|
cannot_be_blank: La tua password non può essere vuota.
|
56
56
|
send_instructions: Riceverai un'email con le istruzioni per resettare la tua password entro qualche minuto.
|
data/config/locales/nl.yml
CHANGED
@@ -25,7 +25,7 @@ nl:
|
|
25
25
|
unlocks:
|
26
26
|
send_instructions: Binnen enkele minuten ontvang je een e-mail om je account te ontgrendelen.
|
27
27
|
unlocked: Je account is succesvol ontgrendeld. Je bent nu ingelogd.
|
28
|
-
|
28
|
+
user_passwords:
|
29
29
|
spree_user:
|
30
30
|
cannot_be_blank: Je wachtwoord kan niet leeg zijn.
|
31
31
|
send_instructions: Binnen enkele minuten ontvang je een e-mail met instructies om je wachtwoord te resetten.
|
data/config/locales/pt-BR.yml
CHANGED
@@ -27,7 +27,7 @@ pt-BR:
|
|
27
27
|
unlocks:
|
28
28
|
send_instructions: Você receberá um e-mail com instruções sobre como desbloquear sua conta em poucos minutos.
|
29
29
|
unlocked: Sua conta foi desbloqueada com sucesso. Agora você está conectado.
|
30
|
-
|
30
|
+
user_passwords:
|
31
31
|
spree_user:
|
32
32
|
cannot_be_blank: Sua senha não pode estar em branco.
|
33
33
|
send_instructions: Você receberá um e-mail com instruções sobre como redefinir sua senha em poucos minutos.
|
data/config/locales/pt.yml
CHANGED
@@ -28,7 +28,7 @@ pt:
|
|
28
28
|
unlocks:
|
29
29
|
send_instructions: Receberá um e-mail com as instruções de desbloqueio da sua conta em poucos minutos.
|
30
30
|
unlocked: A sua conta foi desbloqueada com sucesso. Já se encontra conectado.
|
31
|
-
|
31
|
+
user_passwords:
|
32
32
|
spree_user:
|
33
33
|
cannot_be_blank: A sua senha não pode estar em branco.
|
34
34
|
send_instructions: Receberá um e-mail com as instruções de redefinição da sua senha em poucos minutos.
|
data/config/locales/tr.yml
CHANGED
@@ -25,7 +25,7 @@ tr:
|
|
25
25
|
unlocks:
|
26
26
|
send_instructions: Birkaç dakika içinde hesabınızın kilidini nasıl açacağınızı anlatan bir e-posta alacaksınız.
|
27
27
|
unlocked: Hesabınızın kilidi başarıyla açıldı. Oturumunuz açıldı.
|
28
|
-
|
28
|
+
user_passwords:
|
29
29
|
spree_user:
|
30
30
|
cannot_be_blank: Boş parola giremezsiniz.
|
31
31
|
send_instructions: Birkaç dakika içinde şifrenizi nasıl yeniden ayarlayacağınızı anlatan bir e-posta alacaksınız.
|
data/config/routes.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
Spree::Core::Engine.add_routes do
|
2
2
|
devise_for :spree_user,
|
3
|
-
:
|
4
|
-
:
|
5
|
-
:
|
6
|
-
:
|
7
|
-
:
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
3
|
+
class_name: 'Spree::User',
|
4
|
+
controllers: { sessions: 'spree/user_sessions',
|
5
|
+
registrations: 'spree/user_registrations',
|
6
|
+
passwords: 'spree/user_passwords',
|
7
|
+
confirmations: 'spree/user_confirmations' },
|
8
|
+
skip: [:unlocks, :omniauth_callbacks],
|
9
|
+
path_names: { sign_out: 'logout' },
|
10
|
+
path_prefix: :user
|
11
11
|
|
12
|
-
resources :users, :
|
12
|
+
resources :users, only: [:edit, :update]
|
13
13
|
|
14
14
|
devise_scope :spree_user do
|
15
15
|
get '/login' => 'user_sessions#new', :as => :login
|
@@ -28,22 +28,21 @@ Spree::Core::Engine.add_routes do
|
|
28
28
|
put '/checkout/registration' => 'checkout#update_registration', :as => :update_checkout_registration
|
29
29
|
|
30
30
|
get '/account_link' => 'store#account_link'
|
31
|
-
resource :account, :
|
31
|
+
resource :account, controller: 'users'
|
32
32
|
|
33
33
|
namespace :admin, path: Spree.admin_path do
|
34
34
|
devise_for :spree_user,
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
35
|
+
class_name: 'Spree::User',
|
36
|
+
controllers: { sessions: 'spree/admin/user_sessions',
|
37
|
+
passwords: 'spree/admin/user_passwords' },
|
38
|
+
skip: [:unlocks, :omniauth_callbacks, :registrations],
|
39
|
+
path_names: { sign_out: 'logout' },
|
40
|
+
path_prefix: :user
|
41
41
|
devise_scope :spree_user do
|
42
|
-
get '/authorization_failure', :
|
42
|
+
get '/authorization_failure', to: 'user_sessions#authorization_failure', as: :unauthorized
|
43
43
|
get '/login' => 'user_sessions#new', :as => :login
|
44
44
|
post '/login' => 'user_sessions#create', :as => :create_new_session
|
45
45
|
get '/logout' => 'user_sessions#destroy', :as => :logout
|
46
46
|
end
|
47
|
-
|
48
47
|
end
|
49
48
|
end
|
data/db/default/users.rb
CHANGED
@@ -39,15 +39,15 @@ def create_admin_user
|
|
39
39
|
email = 'spree@example.com'
|
40
40
|
else
|
41
41
|
puts 'Create the admin user (press enter for defaults).'
|
42
|
-
#name = prompt_for_admin_name unless name
|
42
|
+
# name = prompt_for_admin_name unless name
|
43
43
|
email = prompt_for_admin_email
|
44
44
|
password = prompt_for_admin_password
|
45
45
|
end
|
46
46
|
attributes = {
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
47
|
+
password: password,
|
48
|
+
password_confirmation: password,
|
49
|
+
email: email,
|
50
|
+
login: email
|
51
51
|
}
|
52
52
|
|
53
53
|
load 'spree/user.rb'
|
@@ -60,7 +60,7 @@ def create_admin_user
|
|
60
60
|
role = Spree::Role.find_or_create_by(name: 'admin')
|
61
61
|
admin.spree_roles << role
|
62
62
|
admin.save
|
63
|
-
admin.generate_spree_api_key!
|
63
|
+
admin.generate_spree_api_key! if Spree::Auth::Engine.api_available?
|
64
64
|
say "Done!"
|
65
65
|
else
|
66
66
|
say "There was some problems with persisting new admin user:"
|
@@ -1,17 +1,22 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class CreateUsers < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class CreateUsers < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
CreateUsers.class_eval do
|
2
7
|
def up
|
3
|
-
unless
|
4
|
-
create_table "spree_users", :
|
5
|
-
t.string "crypted_password", :
|
6
|
-
t.string "salt", :
|
8
|
+
unless data_source_exists?("spree_users")
|
9
|
+
create_table "spree_users", force: true do |t|
|
10
|
+
t.string "crypted_password", limit: 128
|
11
|
+
t.string "salt", limit: 128
|
7
12
|
t.string "email"
|
8
13
|
t.string "remember_token"
|
9
14
|
t.string "remember_token_expires_at"
|
10
15
|
t.string "persistence_token"
|
11
16
|
t.string "single_access_token"
|
12
17
|
t.string "perishable_token"
|
13
|
-
t.integer "login_count", :
|
14
|
-
t.integer "failed_login_count", :
|
18
|
+
t.integer "login_count", default: 0, null: false
|
19
|
+
t.integer "failed_login_count", default: 0, null: false
|
15
20
|
t.datetime "last_request_at"
|
16
21
|
t.datetime "current_login_at"
|
17
22
|
t.datetime "last_login_at"
|
@@ -20,8 +25,8 @@ class CreateUsers < ActiveRecord::Migration
|
|
20
25
|
t.string "login"
|
21
26
|
t.integer "ship_address_id"
|
22
27
|
t.integer "bill_address_id"
|
23
|
-
t.datetime "created_at", :
|
24
|
-
t.datetime "updated_at", :
|
28
|
+
t.datetime "created_at", null: false
|
29
|
+
t.datetime "updated_at", null: false
|
25
30
|
t.string "openid_identifier"
|
26
31
|
end
|
27
32
|
end
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class RenameColumnsForDevise < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class RenameColumnsForDevise < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
RenameColumnsForDevise.class_eval do
|
2
7
|
def up
|
3
8
|
return if column_exists?(:spree_users, :password_salt)
|
4
9
|
rename_column :spree_users, :crypted_password, :encrypted_password
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class ConvertUserRememberField < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class ConvertUserRememberField < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
ConvertUserRememberField.class_eval do
|
2
7
|
def up
|
3
8
|
remove_column :spree_users, :remember_created_at
|
4
9
|
add_column :spree_users, :remember_created_at, :datetime
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddResetPasswordSentAtToSpreeUsers < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddResetPasswordSentAtToSpreeUsers < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
AddResetPasswordSentAtToSpreeUsers.class_eval do
|
2
7
|
def change
|
3
8
|
Spree::User.reset_column_information
|
4
9
|
unless Spree::User.column_names.include?("reset_password_sent_at")
|
@@ -1,9 +1,14 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class MakeUsersEmailIndexUnique < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class MakeUsersEmailIndexUnique < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
MakeUsersEmailIndexUnique.class_eval do
|
2
7
|
def up
|
3
|
-
add_index "spree_users", ["email"], :
|
8
|
+
add_index "spree_users", ["email"], name: "email_idx_unique", unique: true
|
4
9
|
end
|
5
10
|
|
6
11
|
def down
|
7
|
-
remove_index "spree_users", :
|
12
|
+
remove_index "spree_users", name: "email_idx_unique"
|
8
13
|
end
|
9
14
|
end
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddDeletedAtToUsers < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddDeletedAtToUsers < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
AddDeletedAtToUsers.class_eval do
|
2
7
|
def change
|
3
8
|
add_column :spree_users, :deleted_at, :datetime
|
4
9
|
add_index :spree_users, :deleted_at
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddConfirmableToUsers < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddConfirmableToUsers < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
AddConfirmableToUsers.class_eval do
|
2
7
|
def change
|
3
8
|
add_column :spree_users, :confirmation_token, :string
|
4
9
|
add_column :spree_users, :confirmed_at, :datetime
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddMissingIndicesOnUser < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddMissingIndicesOnUser < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
AddMissingIndicesOnUser.class_eval do
|
2
7
|
def change
|
3
8
|
unless index_exists?(:spree_users, :bill_address_id)
|
4
9
|
add_index :spree_users, :bill_address_id
|
@@ -1,5 +1,4 @@
|
|
1
1
|
Spree::Admin::BaseController.class_eval do
|
2
|
-
|
3
2
|
# Redirect as appropriate when an access request fails. The default action is to redirect to the login screen.
|
4
3
|
# Override this method in your controllers if you want to have special behavior in case the user is not authorized
|
5
4
|
# to access the requested action. For example, a popup window might simply close itself.
|
@@ -15,12 +14,11 @@ Spree::Admin::BaseController.class_eval do
|
|
15
14
|
|
16
15
|
protected
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
nil
|
17
|
+
def model_class
|
18
|
+
const_name = controller_name.classify
|
19
|
+
if Spree.const_defined?(const_name, false)
|
20
|
+
return "Spree::#{const_name}".constantize
|
24
21
|
end
|
25
|
-
|
22
|
+
nil
|
23
|
+
end
|
26
24
|
end
|
@@ -2,19 +2,20 @@ Spree::Admin::OrdersController.class_eval do
|
|
2
2
|
before_action :check_authorization
|
3
3
|
|
4
4
|
private
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
|
6
|
+
def load_order_action
|
7
|
+
[:edit, :update, :cancel, :resume, :approve, :resend, :open_adjustments, :close_adjustments, :cart]
|
8
|
+
end
|
9
|
+
|
10
|
+
def check_authorization
|
11
|
+
action = params[:action].to_sym
|
12
|
+
if load_order_action.include?(action)
|
13
|
+
load_order
|
14
|
+
session[:access_token] ||= params[:token]
|
15
|
+
resource = @order || Spree::Order.new
|
16
|
+
authorize! action, resource, session[:access_token]
|
17
|
+
else
|
18
|
+
authorize! :index, Spree::Order
|
19
19
|
end
|
20
|
+
end
|
20
21
|
end
|
@@ -2,14 +2,15 @@ Spree::Admin::Orders::CustomerDetailsController.class_eval do
|
|
2
2
|
before_action :check_authorization
|
3
3
|
|
4
4
|
private
|
5
|
-
def check_authorization
|
6
|
-
load_order
|
7
|
-
session[:access_token] ||= params[:token]
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
def check_authorization
|
7
|
+
load_order
|
8
|
+
session[:access_token] ||= params[:token]
|
12
9
|
|
13
|
-
|
14
|
-
|
10
|
+
resource = @order
|
11
|
+
action = params[:action].to_sym
|
12
|
+
action = :edit if action == :show # show route renders :edit for this controller
|
13
|
+
|
14
|
+
authorize! action, resource, session[:access_token]
|
15
|
+
end
|
15
16
|
end
|
@@ -20,7 +20,7 @@ class Spree::Admin::UserPasswordsController < Devise::PasswordsController
|
|
20
20
|
|
21
21
|
if resource.errors.empty?
|
22
22
|
set_flash_message(:notice, :send_instructions) if is_navigational_format?
|
23
|
-
respond_with resource, :
|
23
|
+
respond_with resource, location: spree.admin_login_path
|
24
24
|
else
|
25
25
|
respond_with_navigational(resource) { render :new }
|
26
26
|
end
|
@@ -38,4 +38,9 @@ class Spree::Admin::UserPasswordsController < Devise::PasswordsController
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
protected
|
42
|
+
|
43
|
+
def translation_scope
|
44
|
+
'devise.user_passwords'
|
45
|
+
end
|
41
46
|
end
|
@@ -19,7 +19,7 @@ class Spree::Admin::UserSessionsController < Devise::SessionsController
|
|
19
19
|
}
|
20
20
|
format.js {
|
21
21
|
user = resource.record
|
22
|
-
render :
|
22
|
+
render json: { ship_address: user.ship_address, bill_address: user.bill_address }.to_json
|
23
23
|
}
|
24
24
|
end
|
25
25
|
else
|
@@ -28,25 +28,31 @@ class Spree::Admin::UserSessionsController < Devise::SessionsController
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def authorization_failure
|
31
|
+
def authorization_failure; end
|
32
|
+
|
33
|
+
protected
|
34
|
+
|
35
|
+
def translation_scope
|
36
|
+
'devise.user_sessions'
|
32
37
|
end
|
33
38
|
|
34
39
|
private
|
35
|
-
def accurate_title
|
36
|
-
Spree.t(:login)
|
37
|
-
end
|
38
40
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
41
|
+
def accurate_title
|
42
|
+
Spree.t(:login)
|
43
|
+
end
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
def redirect_back_or_default(default)
|
46
|
+
redirect_to(session["spree_user_return_to"] || default)
|
47
|
+
session["spree_user_return_to"] = nil
|
48
|
+
end
|
49
|
+
|
50
|
+
def resolve_layout
|
51
|
+
case action_name
|
52
|
+
when "new", "create"
|
53
|
+
"spree/layouts/login"
|
54
|
+
else
|
55
|
+
"spree/layouts/admin"
|
51
56
|
end
|
57
|
+
end
|
52
58
|
end
|