From a72d687931fa5be3b8828fa202e61d42c607dae1 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 12 Oct 2017 10:24:59 +0200 Subject: Remove Session API --- lib/api/session.rb | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 lib/api/session.rb (limited to 'lib/api/session.rb') diff --git a/lib/api/session.rb b/lib/api/session.rb deleted file mode 100644 index 016415c3023..00000000000 --- a/lib/api/session.rb +++ /dev/null @@ -1,20 +0,0 @@ -module API - class Session < Grape::API - desc 'Login to get token' do - success Entities::UserWithPrivateDetails - end - params do - optional :login, type: String, desc: 'The username' - optional :email, type: String, desc: 'The email of the user' - requires :password, type: String, desc: 'The password of the user' - at_least_one_of :login, :email - end - post "/session" do - user = Gitlab::Auth.find_with_user_password(params[:email] || params[:login], params[:password]) - - return unauthorized! unless user - 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::UserWithPrivateDetails - end - end -end -- cgit v1.2.1