1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-23 01:20:11 +00:00

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

View File

@ -4,7 +4,6 @@ import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"os" "os"
"strconv"
"strings" "strings"
"time" "time"
@ -199,7 +198,7 @@ func (app *appContext) getTokenRefresh(gc *gin.Context) {
return return
} }
claims, ok := token.Claims.(jwt.MapClaims) claims, ok := token.Claims.(jwt.MapClaims)
expiryUnix, err := strconv.ParseInt(claims["exp"].(string), 10, 64) expiryUnix := int64(claims["exp"].(float64))
if err != nil { if err != nil {
app.debug.Printf("getTokenRefresh: Invalid token expiry: %s", err) app.debug.Printf("getTokenRefresh: Invalid token expiry: %s", err)
respond(401, "Invalid token", gc) respond(401, "Invalid token", gc)