]> git.openstreetmap.org Git - rails.git/commitdiff
Log any use of basic authentication
authorTom Hughes <tom@compton.nu>
Fri, 8 Jul 2022 16:13:02 +0000 (17:13 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 8 Jul 2022 16:13:02 +0000 (17:13 +0100)
app/controllers/api_controller.rb

index 050c455cdf64f6bf09bf4e01db8849683fb0cc31..83a35e15f0ecc8aa4bdec8a81067cf44db9e940b 100644 (file)
@@ -109,6 +109,8 @@ class ApiController < ApplicationController
                           else
                             User.authenticate(:username => username, :password => passwd) # basic auth
                           end
+      # log if we have authenticated using basic auth
+      logger.info "Authenticated as user #{current_user.id} using basic authentication" if current_user
     end
 
     # have we identified the user?