Skip to content

Commit aedef3c

Browse files
authored
fix: Prevent lock with unsaved changes (#1640)
1 parent 9690370 commit aedef3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/devise_token_auth/sessions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def resource_params
131131
end
132132

133133
def create_and_assign_token
134-
if @resource.respond_to?(:with_lock)
134+
if @resource.respond_to?(:with_lock) && !@resource.changed?
135135
@resource.with_lock do
136136
@token = @resource.create_token
137137
@resource.save!

0 commit comments

Comments
 (0)