auth: int for refresh token as well

This commit is contained in:
Harvey Tindall 2021-08-22 15:00:20 +01:00
parent 626d623841
commit 5b319d6612
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
1 changed files with 1 additions and 2 deletions

View File

@ -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)