@rivascva/dt-idl 1.1.101 → 1.1.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/go/auth/jwt.go +9 -0
  2. package/package.json +1 -1
package/go/auth/jwt.go CHANGED
@@ -18,6 +18,15 @@ func ValidateToken(token string, secret string) (*jwt.Token, error) {
18
18
  return nil, fmt.Errorf("unable to validate the JWT token: %w", err)
19
19
  }
20
20
 
21
+ // validate the token expiration
22
+ e, err := parsedToken.Claims.GetExpirationTime()
23
+ if err != nil {
24
+ return nil, fmt.Errorf("failed to get the expiration time from the token: %w", err)
25
+ }
26
+ if time.Now().After(e.Time) {
27
+ return nil, fmt.Errorf("the JWT token has expired")
28
+ }
29
+
21
30
  return parsedToken, nil
22
31
  }
23
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivascva/dt-idl",
3
- "version": "1.1.101",
3
+ "version": "1.1.102",
4
4
  "description": "Dream Trade - Interface Definition Language",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",