Commit 33839690 authored by Joshua Gay's avatar Joshua Gay

Add URL to rejection_message if terms_not_accepted

This change improves the OAuth2 error for when users have not accepted
the Terms of Use by providing users with a URL to the gitlab instance
they should sign into in order to accept the Terms of Use.

Changelog: changed
parent 7e240aed
......@@ -15,7 +15,7 @@ module Gitlab
"Your account is pending approval from your administrator and hence blocked."
when :terms_not_accepted
"You (#{@user.to_reference}) must accept the Terms of Service in order to perform this action. "\
"Please access GitLab from a web browser to accept these terms."
"To accept these terms, please access GitLab from a web browser at #{Gitlab.config.gitlab.url}."
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}"
......
......@@ -26,6 +26,7 @@ RSpec.describe Gitlab::Auth::UserAccessDeniedReason do
it { is_expected.to match /must accept the Terms of Service/ }
it { is_expected.to include(user.username) }
it { is_expected.to include(Gitlab.config.gitlab.url) }
end
context 'when the user is internal' 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