|
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 | | - get '/signup' => 'user_registrations#new', :as => :signup |
18 | | - post '/signup' => 'user_registrations#create', :as => :registration |
19 | | - get '/password/recover' => 'user_passwords#new', :as => :recover_password |
20 | | - post '/password/recover' => 'user_passwords#create', :as => :reset_password |
21 | | - get '/password/change' => 'user_passwords#edit', :as => :edit_password |
22 | | - put '/password/change' => 'user_passwords#update', :as => :update_password |
23 | | - get '/confirm' => 'user_confirmations#show', :as => :confirmation |
| 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 | 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.user_class.to_s, |
| 49 | + class_name: Spree.admin_user_class.to_s, |
37 | 50 | controllers: { sessions: 'spree/admin/user_sessions', |
38 | | - passwords: 'spree/admin/user_passwords' }, |
| 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 |
|
0 commit comments