From a4137411c62d093a55dc171665dc90325182bb04 Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Wed, 17 Aug 2016 17:39:20 -0500 Subject: Small refactor and syntax fixes. --- lib/api/session.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/session.rb') diff --git a/lib/api/session.rb b/lib/api/session.rb index b26be3be22e..55ec66a6d67 100644 --- a/lib/api/session.rb +++ b/lib/api/session.rb @@ -14,7 +14,7 @@ module API user = Gitlab::Auth.find_with_user_password(params[:email] || params[:login], params[:password]) return unauthorized! unless user - return render_2fa_error! if user.two_factor_enabled? + return render_api_error!('401 Unauthorized. You have 2FA enabled. Please use a personal access token to access the API', 401) if user.two_factor_enabled? present user, with: Entities::UserLogin end end -- cgit v1.2.1