mirror of
https://github.com/jonasroussel/dart_jsonwebtoken.git
synced 2025-05-21 01:56:19 +08:00
v2.14.0
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
## 2.14.0
|
||||
|
||||
- Add support for base64 encoded secrets (https://github.com/jonasroussel/dart_jsonwebtoken/pull/54)
|
||||
- Fix `exp`, `nbf` and `iat` checks by casting the value to `int`
|
||||
|
||||
## 2.13.0
|
||||
|
||||
- Fix invalid ECDSA signature for keys that are not a multiple of 8 (e.g. secp521r1) (https://github.com/jonasroussel/dart_jsonwebtoken/issues/51)
|
||||
|
@ -63,7 +63,7 @@ class JWT {
|
||||
// exp
|
||||
if (checkExpiresIn && payload.containsKey('exp')) {
|
||||
final exp = DateTime.fromMillisecondsSinceEpoch(
|
||||
payload['exp'] * 1000,
|
||||
(payload['exp'] * 1000).toInt(),
|
||||
);
|
||||
if (exp.isBefore(clock.now())) {
|
||||
throw JWTExpiredException();
|
||||
@ -73,7 +73,7 @@ class JWT {
|
||||
// nbf
|
||||
if (checkNotBefore && payload.containsKey('nbf')) {
|
||||
final nbf = DateTime.fromMillisecondsSinceEpoch(
|
||||
payload['nbf'] * 1000,
|
||||
(payload['nbf'] * 1000).toInt(),
|
||||
);
|
||||
if (nbf.isAfter(clock.now())) {
|
||||
throw JWTNotActiveException();
|
||||
@ -86,7 +86,7 @@ class JWT {
|
||||
throw JWTInvalidException('invalid issue at');
|
||||
}
|
||||
final iat = DateTime.fromMillisecondsSinceEpoch(
|
||||
payload['iat'] * 1000,
|
||||
(payload['iat'] * 1000).toInt(),
|
||||
);
|
||||
if (!iat.isAtSameMomentAs(clock.now())) {
|
||||
throw JWTInvalidException('invalid issue at');
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: dart_jsonwebtoken
|
||||
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
|
||||
version: 2.13.0
|
||||
version: 2.14.0
|
||||
repository: https://github.com/jonasroussel/dart_jsonwebtoken
|
||||
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
||||
|
||||
|
Reference in New Issue
Block a user