diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-09 14:34:10 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-09 14:34:10 +0000 |
commit | ce37a209c6394115eb77c01b877dfd3ae1a6e7e1 (patch) | |
tree | d24546b89574deb33b0df1237779d05a91bc8a5f /lib | |
parent | 9fc9cd03a5381cc2cd8a72a89d67a04a6a5b8a9c (diff) | |
parent | cb5a5eb89265f7261ecc97b6de5bd26ca092960c (diff) | |
download | gitlab-ce-ce37a209c6394115eb77c01b877dfd3ae1a6e7e1.tar.gz |
Merge branch 'pat-msg-on-auth-failure' into 'master'
Prompt user to create personal access token for Git over HTTP
See merge request !11986
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/auth.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index da07ba2f2a3..3933c3b04dd 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -37,7 +37,11 @@ module Gitlab rate_limit!(ip, success: result.success?, login: login) Gitlab::Auth::UniqueIpsLimiter.limit_user!(result.actor) - result + return result if result.success? || current_application_settings.signin_enabled? || Gitlab::LDAP::Config.enabled? + + # If sign-in is disabled and LDAP is not configured, recommend a + # personal access token on failed auth attempts + raise Gitlab::Auth::MissingPersonalTokenError end def find_with_user_password(login, password) |