Commit 072f29fd authored by Aishwarya Subramanian's avatar Aishwarya Subramanian

Return false for unconfirmed email

parent dbdac50a
......@@ -1695,7 +1695,7 @@ class User < ApplicationRecord
def gitlab_employee?
strong_memoize(:gitlab_employee) do
if Gitlab.com?
Mail::Address.new(email).domain == "gitlab.com"
Mail::Address.new(email).domain == "gitlab.com" && confirmed?
else
false
end
......
......@@ -4420,6 +4420,12 @@ describe User, :do_not_mock_admin_mode do
it { is_expected.to be expected_result }
end
context 'when email is of Gitlab and is not confirmed' do
let(:user) { build(:user, email: 'test@gitlab.com', confirmed_at: nil) }
it { is_expected.to be false }
end
end
describe '#current_highest_access_level' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment