From 5b319d66127104fcd58cfdf096170b24c57ae774 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 22 Aug 2021 15:00:20 +0100 Subject: [PATCH] auth: int for refresh token as well --- auth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/auth.go b/auth.go index 74ff570..fb240a3 100644 --- a/auth.go +++ b/auth.go @@ -4,7 +4,6 @@ import ( "encoding/base64" "fmt" "os" - "strconv" "strings" "time" @@ -199,7 +198,7 @@ func (app *appContext) getTokenRefresh(gc *gin.Context) { return } claims, ok := token.Claims.(jwt.MapClaims) - expiryUnix, err := strconv.ParseInt(claims["exp"].(string), 10, 64) + expiryUnix := int64(claims["exp"].(float64)) if err != nil { app.debug.Printf("getTokenRefresh: Invalid token expiry: %s", err) respond(401, "Invalid token", gc)