From 25178b27b81fb7c5dfbde717bd628e44f99547b9 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 24 Aug 2021 10:35:55 +0200 Subject: [PATCH] Follow up - 467bc03224 - Fixes #2389 - Broken Setting structure for Auth::Backend adapters. --- ...210728103633_move_auth_backends_to_database.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/db/migrate/20210728103633_move_auth_backends_to_database.rb b/db/migrate/20210728103633_move_auth_backends_to_database.rb index 64a8709d3..8fd006f3a 100644 --- a/db/migrate/20210728103633_move_auth_backends_to_database.rb +++ b/db/migrate/20210728103633_move_auth_backends_to_database.rb @@ -18,7 +18,7 @@ class MoveAuthBackendsToDatabase < ActiveRecord::Migration[6.0] }, state: { priority: 1, - adapter: 'Auth::Internal', + adapter: 'Auth::Backend::Internal', }, frontend: false ) @@ -34,20 +34,29 @@ class MoveAuthBackendsToDatabase < ActiveRecord::Migration[6.0] }, state: { priority: 2, - adapter: 'Auth::Developer', + adapter: 'Auth::Backend::Developer', }, frontend: false ) + update_auth_ldap + end + + private + + def update_auth_ldap # rubocop:disable Metrics/AbcSize + begin auth_ldap = Setting.find_by(name: 'auth_ldap') auth_ldap.state_initial[:value][:priority] = 3 + auth_ldap.state_initial[:value][:adapter] = 'Auth::Backend::Ldap' auth_ldap.state_current[:value][:priority] = 3 + auth_ldap.state_current[:value][:adapter] = 'Auth::Backend::Ldap' auth_ldap.save! rescue => e - Rails.logger.error "Error while updating 'auth_ldap' Setting priority" + Rails.logger.error "Error while updating 'auth_ldap' Setting priority and adapter" Rails.logger.error e end end