From 551e826a35c1a55f11e1c8e1d0b7efd0813490db Mon Sep 17 00:00:00 2001 From: naiba Date: Fri, 8 Nov 2024 23:57:15 +0800 Subject: [PATCH] fix: update refresh token endpoint to use hyphen --- cmd/dashboard/controller/controller.go | 2 +- cmd/dashboard/controller/jwt.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/dashboard/controller/controller.go b/cmd/dashboard/controller/controller.go index eea190d6..5132d32b 100644 --- a/cmd/dashboard/controller/controller.go +++ b/cmd/dashboard/controller/controller.go @@ -63,7 +63,7 @@ func routers(r *gin.Engine) { auth := api.Group("", authMiddleware.MiddlewareFunc()) - auth.GET("/refresh_token", authMiddleware.RefreshHandler) + auth.GET("/refresh-token", authMiddleware.RefreshHandler) auth.POST("/terminal", commonHandler(createTerminal)) auth.GET("/ws/terminal/:id", commonHandler(terminalStream)) diff --git a/cmd/dashboard/controller/jwt.go b/cmd/dashboard/controller/jwt.go index 2ad3cdfc..bc5ec4ee 100644 --- a/cmd/dashboard/controller/jwt.go +++ b/cmd/dashboard/controller/jwt.go @@ -122,7 +122,7 @@ func unauthorized() func(c *gin.Context, code int, message string) { // @Tags auth required // @Produce json // @Success 200 {object} model.CommonResponse[model.LoginResponse] -// @Router /refresh_token [get] +// @Router /refresh-token [get] func refreshResponse(c *gin.Context, code int, token string, expire time.Time) { c.JSON(http.StatusOK, model.CommonResponse[model.LoginResponse]{ Success: true,