Class: ApiGuard::AuthenticationController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ApiGuard::AuthenticationController
- Defined in:
- app/controllers/api_guard/authentication_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/controllers/api_guard/authentication_controller.rb', line 10 def create if resource.authenticate(params[:password]) create_token_and_set_header(resource, resource_name) render_success(message: I18n.t('api_guard.authentication.signed_in')) else render_error(422, message: I18n.t('api_guard.authentication.invalid_login_credentials')) end end |
#destroy ⇒ Object
19 20 21 22 |
# File 'app/controllers/api_guard/authentication_controller.rb', line 19 def destroy blacklist_token render_success(message: I18n.t('api_guard.authentication.signed_out')) end |