mirror of
https://forgejo.merr.is/annika/jwtauth.git
synced 2025-12-11 18:41:09 -05:00
Case for when exp value is json.Number with custom parser
This commit is contained in:
parent
35183c04d2
commit
4179debd0a
1 changed files with 3 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package jwtauth
|
package jwtauth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -169,6 +170,8 @@ func (ja *JwtAuth) IsExpired(t *jwt.Token) bool {
|
||||||
exp = int64(v)
|
exp = int64(v)
|
||||||
case int64:
|
case int64:
|
||||||
exp = v
|
exp = v
|
||||||
|
case json.Number:
|
||||||
|
exp, _ = v.Int64()
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue