Add JWT key diagnostics

This commit is contained in:
2026-05-21 12:45:28 -05:00
parent fcbafce44c
commit 961662a10e
2 changed files with 24 additions and 3 deletions

View File

@@ -20,3 +20,16 @@ Route::prefix('v1')->middleware(['jwt.auth'])->group(function () {
// Jogos
Route::get('/games/most-played', [GameController::class, 'mostPlayed']);
});
Route::get('/health-check-key', function () {
$rawPublicKey = (string) config('jwt.public_key');
$formattedPublicKey = str_replace('\\n', "\n", $rawPublicKey);
$publicKeyResource = openssl_pkey_get_public($formattedPublicKey);
return response()->json([
'raw_key_empty' => $rawPublicKey === '',
'key_length' => strlen($formattedPublicKey),
'openssl_accepted' => $publicKeyResource !== false,
'openssl_error' => openssl_error_string(),
]);
});