mirror of
https://github.com/jonasroussel/dart_jsonwebtoken.git
synced 2025-08-06 13:51:08 +08:00
v2.3.0
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
## 2.3.0
|
||||
|
||||
- Adding `header` in JWT class (you can now set your custom header)
|
||||
|
||||
## 2.2.0
|
||||
|
||||
- Fixing EdDSA incompatibility's with flutter web (https://github.com/jonasroussel/jsonwebtoken/issues/11)
|
||||
- Fixing EdDSA incompatibility's with flutter web (https://github.com/jonasroussel/dart_jsonwebtoken/issues/11)
|
||||
- Dependencies: `ed25519_edwards` have been removed, `convert` & `collection` have been added
|
||||
|
||||
## 2.1.1
|
||||
@ -9,7 +13,7 @@
|
||||
|
||||
## 2.1.0
|
||||
|
||||
- When an undefined error occur `JWTUndefinedError` is thrown containing the original error in `error` property (https://github.com/jonasroussel/jsonwebtoken/issues/9)
|
||||
- When an undefined error occur `JWTUndefinedError` is thrown containing the original error in `error` property (https://github.com/jonasroussel/dart_jsonwebtoken/issues/9)
|
||||
- **BREAKING CHANGE**: `jwt.verify` no longer support `throwUndefinedErrors` parameter
|
||||
|
||||
## 2.0.1
|
||||
|
@ -26,7 +26,7 @@ final jwt = JWT(
|
||||
'loc': 'euw-2',
|
||||
}
|
||||
},
|
||||
issuer: 'https://github.com/jonasroussel/jsonwebtoken',
|
||||
issuer: 'https://github.com/jonasroussel/dart_jsonwebtoken',
|
||||
);
|
||||
|
||||
// Sign it (default with HS256 algorithm)
|
||||
|
@ -30,7 +30,7 @@ void hs256() {
|
||||
'loc': 'euw-2',
|
||||
}
|
||||
},
|
||||
issuer: 'https://github.com/jonasroussel/jsonwebtoken',
|
||||
issuer: 'https://github.com/jonasroussel/dart_jsonwebtoken',
|
||||
);
|
||||
|
||||
// Sign it
|
||||
@ -67,7 +67,7 @@ void rs256() {
|
||||
'loc': 'euw-2',
|
||||
}
|
||||
},
|
||||
issuer: 'https://github.com/jonasroussel/jsonwebtoken',
|
||||
issuer: 'https://github.com/jonasroussel/dart_jsonwebtoken',
|
||||
);
|
||||
|
||||
// Sign it
|
||||
@ -110,7 +110,7 @@ void es256() {
|
||||
'loc': 'euw-2',
|
||||
}
|
||||
},
|
||||
issuer: 'https://github.com/jonasroussel/jsonwebtoken',
|
||||
issuer: 'https://github.com/jonasroussel/dart_jsonwebtoken',
|
||||
);
|
||||
|
||||
// Sign it
|
||||
|
@ -119,6 +119,7 @@ class JWT {
|
||||
|
||||
return JWT(
|
||||
payload,
|
||||
header: header,
|
||||
audience: payload.remove('aud'),
|
||||
issuer: payload.remove('iss'),
|
||||
subject: payload.remove('sub'),
|
||||
@ -143,6 +144,7 @@ class JWT {
|
||||
this.subject,
|
||||
this.issuer,
|
||||
this.jwtId,
|
||||
this.header,
|
||||
});
|
||||
|
||||
/// Custom claims
|
||||
@ -160,6 +162,9 @@ class JWT {
|
||||
/// JWT Id claim
|
||||
String? jwtId;
|
||||
|
||||
/// JWT header
|
||||
Map<String, dynamic>? header;
|
||||
|
||||
/// Sign and generate a new token.
|
||||
///
|
||||
/// `key` must be
|
||||
@ -175,7 +180,8 @@ class JWT {
|
||||
bool noIssueAt = false,
|
||||
}) {
|
||||
try {
|
||||
final header = {'alg': algorithm.name, 'typ': 'JWT'};
|
||||
header ??= {};
|
||||
header!.addAll({'alg': algorithm.name, 'typ': 'JWT'});
|
||||
|
||||
if (payload is Map<String, dynamic> || payload is Map<dynamic, dynamic>) {
|
||||
try {
|
||||
|
@ -1,15 +1,15 @@
|
||||
name: dart_jsonwebtoken
|
||||
description: A dart implementation of the famous javascript library 'jsonwebtoken' (JWT).
|
||||
version: 2.2.0
|
||||
repository: https://github.com/jonasroussel/jsonwebtoken
|
||||
homepage: https://github.com/jonasroussel/jsonwebtoken#readme
|
||||
version: 2.3.0
|
||||
repository: https://github.com/jonasroussel/dart_jsonwebtoken
|
||||
homepage: https://github.com/jonasroussel/dart_jsonwebtoken#readme
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
dependencies:
|
||||
crypto: ^3.0.1
|
||||
pointycastle: ^3.0.1
|
||||
pointycastle: ^3.1.1
|
||||
convert: ^3.0.0
|
||||
collection: ^1.15.0
|
||||
|
||||
|
Reference in New Issue
Block a user