File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,10 @@ def send_unlock_instructions(attributes = {})
187187 # If the user is not locked, creates an error for the user
188188 # Options must have the unlock_token
189189 def unlock_access_by_token ( unlock_token )
190- original_token = unlock_token
191- unlock_token = Devise . token_generator . digest ( self , :unlock_token , unlock_token )
190+ unlock_token = Devise . token_generator . digest ( self , :unlock_token , unlock_token )
192191
193192 lockable = find_or_initialize_with_error_by ( :unlock_token , unlock_token )
194193 lockable . unlock_access! if lockable . persisted?
195- lockable . unlock_token = original_token
196194 lockable
197195 end
198196
Original file line number Diff line number Diff line change @@ -201,7 +201,9 @@ def setup
201201 raw = user . send_unlock_instructions
202202 locked_user = User . unlock_access_by_token ( raw )
203203 assert_equal user , locked_user
204+ assert_not locked_user . changed?
204205 assert_not user . reload . access_locked?
206+ assert_nil user . reload . unlock_token
205207 end
206208
207209 test 'should return a new record with errors when a invalid token is given' do
You can’t perform that action at this time.
0 commit comments