Class: JwtAuthEngine::PingController

Inherits:
ApplicationController show all
Defined in:
app/controllers/jwt_auth_engine/ping_controller.rb

Overview

Health check endpoints for public and authenticated connectivity.

Instance Method Summary collapse

Methods included from ResponseRenderable

#render_internal_server_error, #render_success, #render_unauthorized, #render_validation_error

Instance Method Details

#authenticated_pingObject

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

#pingObject

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