From 0c524b240858303b40078608dd76a1b2b6023b47 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 8 Jul 2022 17:13:02 +0100 Subject: [PATCH] Log any use of basic authentication --- app/controllers/api_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 050c455cd..83a35e15f 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -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? -- 2.39.5