From 9e1581d9b6330f50a7935463077b57c7a80d85f9 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 28 Mar 2022 15:14:52 +0200 Subject: [PATCH] Follow up b930827b77736948cf4cb4e82b8f2296d3e014e1 - Fixes #3240 - Fixed key for microsoft migration. --- lib/external_credential/microsoft365.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/external_credential/microsoft365.rb b/lib/external_credential/microsoft365.rb index 19412c4ec..55da04a99 100644 --- a/lib/external_credential/microsoft365.rb +++ b/lib/external_credential/microsoft365.rb @@ -91,7 +91,7 @@ class ExternalCredential::Microsoft365 Channel.where(area: 'Email::Account').find_each do |channel| next if channel.options.dig(:inbound, :options, :host)&.downcase != 'outlook.office365.com' next if channel.options.dig(:outbound, :options, :host)&.downcase != 'smtp.office365.com' - next if channel.options.dig(:outbound, :options, :user)&.downcase != user_data[:email].downcase && channel.options.dig(:outbound, :email)&.downcase != user_data[:email].downcase + next if channel.options.dig(:outbound, :options, :user)&.downcase != user_data[:preferred_username].downcase && channel.options.dig(:outbound, :email)&.downcase != user_data[:preferred_username].downcase migrate_channel = channel