Skip to content

Commit b7fb41f

Browse files
committed
feat: shaanda
1 parent d278f5d commit b7fb41f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/controller/auth.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/jackc/pgx/v5/pgtype"
1515
"github.com/labstack/echo/v4"
1616
"golang.org/x/crypto/bcrypt"
17+
"github.com/golang-jwt/jwt/v5"
1718
)
1819

1920
func SignUp(c echo.Context) error {
@@ -565,7 +566,7 @@ func UpdatePassword(c echo.Context) error {
565566
}
566567

567568
func RefreshToken(c echo.Context) error {
568-
refToken = c.Get("user").(*jwt.Token)
569+
refToken := c.Get("user").(*jwt.Token)
569570
claims := refToken.Claims.(*utils.JWTClaims)
570571

571572
token, err := utils.GenerateToken(&claims.UserID, false)
@@ -577,7 +578,7 @@ func RefreshToken(c echo.Context) error {
577578
})
578579
}
579580

580-
newRefreshToken, err := utils.GenerateToken(&refreshClaims.UserID, true)
581+
newRefreshToken, err := utils.GenerateToken(&claims.UserID, true)
581582
if err != nil {
582583
logger.Errorf(logger.InternalError, err.Error())
583584
return c.JSON(http.StatusInternalServerError, &models.Response{

0 commit comments

Comments
 (0)