bugfixing refresh token
This commit is contained in:
@@ -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"})
|
||||||
|
|||||||
Reference in New Issue
Block a user