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