diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-10-12 11:24:59 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-02 13:39:01 +0300 |
commit | a72d687931fa5be3b8828fa202e61d42c607dae1 (patch) | |
tree | 20ca486ace5d7462e6bc5069a6f2169d3c12c026 /lib | |
parent | 4b93429a4e7161460ecde6b0cf56480b03e8e600 (diff) |
Remove Session API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/api.rb | 1 | ||||
-rw-r--r-- | lib/api/session.rb | 20 |
2 files changed, 0 insertions, 21 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 7db18e25a5f..c37e596eb9d 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -142,7 +142,6 @@ module API mount ::API::Runner mount ::API::Runners mount ::API::Services - mount ::API::Session mount ::API::Settings mount ::API::SidekiqMetrics mount ::API::Snippets 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 |