bugfixing refresh token

This commit is contained in:
2025-12-09 22:39:05 +00:00
parent 461691c799
commit 948f5179a2

View File

@@ -1,6 +1,7 @@
package handlers package handlers
import ( import (
"fmt"
"net/http" "net/http"
"adam-french.co.uk/backend/models" "adam-french.co.uk/backend/models"
@@ -68,6 +69,8 @@ func (store *Store) RefreshToken(ctx *gin.Context) {
ctx.JSON(http.StatusUnauthorized, err.Error()) ctx.JSON(http.StatusUnauthorized, err.Error())
} }
fmt.Printf("claims: %v\n", claims)
userID, ok := (*claims)["id"].(uint) userID, ok := (*claims)["id"].(uint)
if !ok { if !ok {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": "invalid token claims"}) ctx.JSON(http.StatusInternalServerError, gin.H{"error": "invalid token claims"})