Class: JwtAuthEngine::PingController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- JwtAuthEngine::PingController
- Defined in:
- app/controllers/jwt_auth_engine/ping_controller.rb
Overview
Health check endpoints for public and authenticated connectivity.
Instance Method Summary collapse
-
#authenticated_ping ⇒ Object
GET /authenticated_ping Protected — valid Bearer access token required.
-
#ping ⇒ Object
GET /ping Public — no auth required.
Methods included from ResponseRenderable
#render_internal_server_error, #render_success, #render_unauthorized, #render_validation_error
Instance Method Details
#authenticated_ping ⇒ Object
GET /authenticated_ping Protected — valid Bearer access token required
16 17 18 19 |
# File 'app/controllers/jwt_auth_engine/ping_controller.rb', line 16 def authenticated_ping recipient = current_auth_model_instance.public_send(JwtAuthEngine.identifier_field) render_success(message: "pong! Hello #{recipient}, you are authenticated.") end |
#ping ⇒ Object
GET /ping Public — no auth required
10 11 12 |
# File 'app/controllers/jwt_auth_engine/ping_controller.rb', line 10 def ping render_success(message: 'pong!') end |