From ff9544e08b2cdb10d30ec0302489bad5ee0b5256 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 25 Nov 2022 15:45:25 +1100 Subject: [PATCH] Allow AuthorizationControl to run without Warden As explained in 36c44a548799ccdaddd1f3848110cc240fb96f29, it's not normally good to change production code to make testing easier. But this tiny change makes it more robust, and enables much simpler specs. --- .../app/services/dfc_provider/authorization_control.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/dfc_provider/app/services/dfc_provider/authorization_control.rb b/engines/dfc_provider/app/services/dfc_provider/authorization_control.rb index a7da60984b..071ac4dda9 100644 --- a/engines/dfc_provider/app/services/dfc_provider/authorization_control.rb +++ b/engines/dfc_provider/app/services/dfc_provider/authorization_control.rb @@ -32,7 +32,7 @@ module DfcProvider end def ofn_user - @request.env['warden'].user + @request.env['warden']&.user end def decode_token