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,6 +1,11 @@
|
|||||||
|
## 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
|
## 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)
|
- Fix invalid ECDSA signature for keys that are not a multiple of 8 (e.g. secp521r1) (https://github.com/jonasroussel/dart_jsonwebtoken/issues/51)
|
||||||
|
|
||||||
## 2.12.2
|
## 2.12.2
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class JWT {
|
|||||||
// exp
|
// exp
|
||||||
if (checkExpiresIn && payload.containsKey('exp')) {
|
if (checkExpiresIn && payload.containsKey('exp')) {
|
||||||
final exp = DateTime.fromMillisecondsSinceEpoch(
|
final exp = DateTime.fromMillisecondsSinceEpoch(
|
||||||
payload['exp'] * 1000,
|
(payload['exp'] * 1000).toInt(),
|
||||||
);
|
);
|
||||||
if (exp.isBefore(clock.now())) {
|
if (exp.isBefore(clock.now())) {
|
||||||
throw JWTExpiredException();
|
throw JWTExpiredException();
|
||||||
@ -73,7 +73,7 @@ class JWT {
|
|||||||
// nbf
|
// nbf
|
||||||
if (checkNotBefore && payload.containsKey('nbf')) {
|
if (checkNotBefore && payload.containsKey('nbf')) {
|
||||||
final nbf = DateTime.fromMillisecondsSinceEpoch(
|
final nbf = DateTime.fromMillisecondsSinceEpoch(
|
||||||
payload['nbf'] * 1000,
|
(payload['nbf'] * 1000).toInt(),
|
||||||
);
|
);
|
||||||
if (nbf.isAfter(clock.now())) {
|
if (nbf.isAfter(clock.now())) {
|
||||||
throw JWTNotActiveException();
|
throw JWTNotActiveException();
|
||||||
@ -86,7 +86,7 @@ class JWT {
|
|||||||
throw JWTInvalidException('invalid issue at');
|
throw JWTInvalidException('invalid issue at');
|
||||||
}
|
}
|
||||||
final iat = DateTime.fromMillisecondsSinceEpoch(
|
final iat = DateTime.fromMillisecondsSinceEpoch(
|
||||||
payload['iat'] * 1000,
|
(payload['iat'] * 1000).toInt(),
|
||||||
);
|
);
|
||||||
if (!iat.isAtSameMomentAs(clock.now())) {
|
if (!iat.isAtSameMomentAs(clock.now())) {
|
||||||
throw JWTInvalidException('invalid issue at');
|
throw JWTInvalidException('invalid issue at');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: dart_jsonwebtoken
|
name: dart_jsonwebtoken
|
||||||
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
|
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
|
repository: https://github.com/jonasroussel/dart_jsonwebtoken
|
||||||
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user