openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.1k stars 713 forks source link

Merge Spree::UserPasswordsController into UserPasswordsController and Spree::UserRegistrationsController into UserRegistrationsController #4019

Open luisramos0 opened 5 years ago

luisramos0 commented 5 years ago

What we should change and why (this is tech debt)

Similar to #2763 (checkoutcontrollers), after we deleted spree_auth_devise we have userpasswords and userRegistrations in the ofn codebase, we can delete most of this code, but we need to do it carefully not to break any of the existing auth processes in OFN.

there's probably a good bit of dead code in these controllers.

Context

Not done as part of #3700 just because it's quite a bit of work to remove code and verify every part of the existing auth processes.

Impact and timeline

This will make our auth code much simpler.

luisramos0 commented 5 years ago

this branch starts this work: https://github.com/luisramos0/openfoodnetwork/tree/simple_user_regs_pwds

luisramos0 commented 4 years ago

In the context of #5076 I wonder if UserPasswords is not all of it just dead code...

we have:

do we even use any of the devise pages? I wonder how much of these routes are just dead code:

  devise_scope :spree_user do
    get '/login' => 'user_sessions#new', :as => :login
    post '/login' => 'user_sessions#create', :as => :create_new_session
    get '/logout' => 'user_sessions#destroy', :as => :logout
    get '/signup' => 'user_registrations#new', :as => :signup
    post '/signup' => 'user_registrations#create', :as => :registration
    get '/password/recover' => 'user_passwords#new', :as => :recover_password
    post '/password/recover' => 'user_passwords#create', :as => :reset_password
    get '/password/change' => 'user_passwords#edit', :as => :edit_password
    put '/password/change' => 'user_passwords#update', :as => :update_password
  end