Skip to content

Commit

Permalink
fix: Prevent lock with unsaved changes (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
btagliani authored Jan 10, 2025
1 parent 9690370 commit aedef3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/devise_token_auth/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def resource_params
end

def create_and_assign_token
if @resource.respond_to?(:with_lock)
if @resource.respond_to?(:with_lock) && !@resource.changed?
@resource.with_lock do
@token = @resource.create_token
@resource.save!
Expand Down

0 comments on commit aedef3c

Please sign in to comment.