blob: cc6468959142170b5ac3a06145cf27aa5551149e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
module API
# Users API
class Session < Grape::API
# Login to get token
#
# Parameters:
# login (*required) - user login
# email (*required) - user email
# password (required) - user password
#
# Example Request:
# POST /session
post "/session" do
auth = Gitlab::Auth.new
user = auth.find(params[:email] || params[:login], params[:password])
return unauthorized! unless user
present user, with: Entities::UserLogin
end
end
end
|