Class: Api::V2::AuthenticationController
- Inherits:
-
ActionController::API
- Object
- ActionController::API
- Api::V2::AuthenticationController
- 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.headers['Token'] = command.result[:jwt] # head :ok render json: command.result[:user].to_json(User.json_attrs), status: 200 end end |