Skip to content

Commit 38b1eb2

Browse files
committed
fix: remove duplicate thread-local variable assignment
1 parent f0e9bfd commit 38b1eb2

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

app/controllers/concerns/authenticatable.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ def authenticate_request!
3030
@current_user = User.unscoped.find(@jwt_payload[:user_id])
3131
@current_organization = @current_user.organization
3232

33-
# Set thread-local variables BEFORE update_last_login! to ensure AuditLog creation works
34-
Thread.current[:current_organization_id] = @current_organization.id
35-
Thread.current[:current_user_id] = @current_user.id
36-
Thread.current[:current_user_role] = @current_user.role
37-
38-
# Update last login time
33+
# Update last login time (uses update_column which skips callbacks/audit logs)
3934
@current_user.update_last_login! if should_update_last_login?
4035
rescue Authentication::Services::JwtService::AuthenticationError => e
4136
Rails.logger.error("JWT Authentication error: #{e.class} - #{e.message}")

0 commit comments

Comments
 (0)