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