Class: Api::V2::AuthenticationController
- Inherits:
-
ActionController::API
- Object
- ActionController::API
- Api::V2::AuthenticationController
show all
- Includes:
- ApiExceptionManagement
- Defined in:
- app/controllers/api/v2/authentication_controller.rb
Instance Method Summary
collapse
Instance Method Details
#authenticate ⇒ Object
4
5
6
7
8
9
10
11
12
|
# File 'app/controllers/api/v2/authentication_controller.rb', line 4
def authenticate
command = AuthenticateUser.call(email: params[:auth][:email], password: params[:auth][:password])
if command.success?
response.['Token'] = command.result[:jwt]
render json: command.result[:user].to_json(User.json_attrs), status: 200
end
end
|