From 14899733c8c5962a8b4ed5c13836f86a34bd29a0 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Fri, 18 Apr 2025 15:37:50 +0000 Subject: [bugfix] new token API issues (#4022) * fix incorrect endpoint being registered for /token/{id} * update the maximum page value for tokens endpoint to 100 * update the available tokens page options * set a default limit of 25 to match the first available settings panel option * ensure OnInvalidateToken() hook is called during token delete --- internal/api/client/tokens/tokens.go | 2 +- internal/api/client/tokens/tokensget.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/api/client/tokens') diff --git a/internal/api/client/tokens/tokens.go b/internal/api/client/tokens/tokens.go index ce00a6459..aadaf72c2 100644 --- a/internal/api/client/tokens/tokens.go +++ b/internal/api/client/tokens/tokens.go @@ -43,6 +43,6 @@ func New(processor *processing.Processor) *Module { func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes) { attachHandler(http.MethodGet, BasePath, m.TokensInfoGETHandler) - attachHandler(http.MethodGet, BasePathWithID, m.TokensInfoGETHandler) + attachHandler(http.MethodGet, BasePathWithID, m.TokenInfoGETHandler) attachHandler(http.MethodPost, InvalidateTokenPath, m.TokenInvalidatePOSTHandler) } diff --git a/internal/api/client/tokens/tokensget.go b/internal/api/client/tokens/tokensget.go index 15fc5511f..5c92beccc 100644 --- a/internal/api/client/tokens/tokensget.go +++ b/internal/api/client/tokens/tokensget.go @@ -117,9 +117,9 @@ func (m *Module) TokensInfoGETHandler(c *gin.Context) { } page, errWithCode := paging.ParseIDPage(c, - 0, // min limit - 80, // max limit - 20, // default limit + 0, // min limit + 100, // max limit + 25, // default limit ) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) -- cgit v1.2.3