]> git.openstreetmap.org Git - rails.git/commitdiff
Include both copies of the password in the saved user
authorTom Hughes <tom@compton.nu>
Fri, 12 Jan 2024 17:41:13 +0000 (17:41 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 12 Jan 2024 17:55:16 +0000 (17:55 +0000)
This allows is to go back to hashing passwords when the user is saved.

Fixes #4474

app/controllers/users_controller.rb
app/models/user.rb

index 961be4024657a5eb80d206440461035f780a33af..ab13f93bed402541f31e6d470419128b6b29e6d5 100644 (file)
@@ -104,11 +104,11 @@ class UsersController < ApplicationController
         render :action => "new"
       elsif current_user.auth_provider.present?
         # Verify external authenticator before moving on
-        session[:new_user] = current_user.attributes.slice("email", "display_name", "pass_crypt")
+        session[:new_user] = current_user.slice("email", "display_name", "pass_crypt", "pass_crypt_confirmation")
         redirect_to auth_url(current_user.auth_provider, current_user.auth_uid), :status => :temporary_redirect
       else
         # Save the user record
-        session[:new_user] = current_user.attributes.slice("email", "display_name", "pass_crypt")
+        session[:new_user] = current_user.slice("email", "display_name", "pass_crypt", "pass_crypt_confirmation")
         redirect_to :action => :terms
       end
     end
index 5790d81e51d1be60d561eaa934aa863e2aad913b..bc95f20c1568fe70cdd436c3ce96d1b8fd48ad42 100644 (file)
@@ -119,7 +119,6 @@ class User < ApplicationRecord
 
   alias_attribute :created_at, :creation_time
 
-  after_initialize :encrypt_password
   before_save :encrypt_password
   before_save :update_tile
   after_save :spam_check