From 3c2e0cdcb87bcefd9f2772f35d99e2a0d27be1f3 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Fri, 9 May 2025 10:49:24 -0500 Subject: [PATCH] /token should provide JSON --- app.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.rb b/app.rb index 9c8e441..e984872 100644 --- a/app.rb +++ b/app.rb @@ -380,14 +380,13 @@ get "/pid", provides: "json" do jsonify({ppid: ppid, pid: Process.pid}, pretty:) end -get "/token" do +get "/token", provides: "json" do exp = Time.now.to_i + SECONDS_PER_MINUTE * 2 payload = {name: "anonymous", exp: exp, jti: Random.uuid} expires_at = Time.at(exp).to_datetime token = JWT.encode payload, config.jwt_secret.unwrap, "HS256" x = {token: token, expires_at: expires_at} - jsonify x end get "/token/validate" do