From c11f013e044e04f6e32dbdb235c6907e9b5bac85 Mon Sep 17 00:00:00 2001 From: DacongDA Date: Tue, 8 Apr 2025 23:20:44 +0800 Subject: [PATCH] feat: return "Active: false" for expired token in IntrospectToken() (#3714) --- controllers/token.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controllers/token.go b/controllers/token.go index 7deb1eab..8b4ffc20 100644 --- a/controllers/token.go +++ b/controllers/token.go @@ -334,6 +334,12 @@ func (c *ApiController) IntrospectToken() { c.ServeJSON() return } + + if token.ExpiresIn <= 0 { + c.Data["json"] = &object.IntrospectionResponse{Active: false} + c.ServeJSON() + return + } } var introspectionResponse object.IntrospectionResponse