Commit dc6b984c authored by Stan Hu's avatar Stan Hu

Merge branch 'show-email-unconfirmed-message-in-git-auth' into 'master'

Better error message for unconfirmed users when using git

See merge request gitlab-org/gitlab!37944
parents 6e7c5906 42a9b96e
---
title: Provide better git error message when the user is unconfirmed
merge_request: 37944
author:
type: fixed
......@@ -17,6 +17,10 @@ module Gitlab
when :deactivated
"Your account has been deactivated by your administrator. "\
"Please log back in from a web browser to reactivate your account at #{Gitlab.config.gitlab.url}"
when :unconfirmed
"Your primary email address is not confirmed. "\
"Please check your inbox for the confirmation instructions. "\
"In case the link is expired, you can request a new confirmation email at #{Rails.application.routes.url_helpers.new_user_confirmation_url}"
else
"Your account has been blocked."
end
......@@ -31,6 +35,8 @@ module Gitlab
:terms_not_accepted
elsif @user.deactivated?
:deactivated
elsif !@user.confirmed?
:unconfirmed
else
:blocked
end
......
......@@ -41,5 +41,13 @@ RSpec.describe Gitlab::Auth::UserAccessDeniedReason do
it { is_expected.to eq "Your account has been deactivated by your administrator. Please log back in from a web browser to reactivate your account at #{Gitlab.config.gitlab.url}" }
end
context 'when the user is unconfirmed' do
before do
user.update!(confirmed_at: nil)
end
it { is_expected.to match /Your primary email address is not confirmed/ }
end
end
end
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