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:
parent
626d623841
commit
5b319d6612
3
auth.go
3
auth.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user