File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 ErrTokenNotFound = errors .New ("token not found in DB" )
1717 ErrTokenParse = errors .New ("unable to parse token" )
1818 ErrTokenMissingClaim = errors .New ("token missing required claim" )
19- ErrTokenTooOld = errors .New ("token too old" )
2019 ErrTokenExpired = errors .New ("token expired" )
2120)
2221
@@ -49,16 +48,6 @@ func (c *Client) LoadAPICToken(ctx context.Context, logger logrus.FieldLogger) (
4948 return APICToken {}, ErrTokenParse
5049 }
5150
52- iatFloat , ok := claims ["iat" ].(float64 )
53- if ! ok {
54- return APICToken {}, fmt .Errorf ("%w: iat" , ErrTokenMissingClaim )
55- }
56-
57- iat := time .Unix (int64 (iatFloat ), 0 )
58- if time .Now ().UTC ().After (iat .Add (1 * time .Minute )) {
59- return APICToken {}, ErrTokenTooOld
60- }
61-
6251 expFloat , ok := claims ["exp" ].(float64 )
6352 if ! ok {
6453 return APICToken {}, fmt .Errorf ("%w: exp" , ErrTokenMissingClaim )
You can’t perform that action at this time.
0 commit comments