mirror of
https://github.com/jonasroussel/dart_jsonwebtoken.git
synced 2025-08-06 13:51:08 +08:00
v2.8.0
This commit is contained in:
@ -45,9 +45,9 @@ void hs256() {
|
||||
final jwt = JWT.verify(token, SecretKey('secret passphrase'));
|
||||
|
||||
print('Payload: ${jwt.payload}');
|
||||
} on JWTExpiredError {
|
||||
} on JWTExpiredException {
|
||||
print('jwt expired');
|
||||
} on JWTError catch (ex) {
|
||||
} on JWTException catch (ex) {
|
||||
print(ex.message); // ex: invalid signature
|
||||
}
|
||||
}
|
||||
@ -88,9 +88,9 @@ void rs256() {
|
||||
final jwt = JWT.verify(token, key);
|
||||
|
||||
print('Payload: ${jwt.payload}');
|
||||
} on JWTExpiredError {
|
||||
} on JWTExpiredException {
|
||||
print('jwt expired');
|
||||
} on JWTError catch (ex) {
|
||||
} on JWTException catch (ex) {
|
||||
print(ex.message); // ex: invalid signature
|
||||
}
|
||||
}
|
||||
@ -131,9 +131,9 @@ void es256() {
|
||||
final jwt = JWT.verify(token, key);
|
||||
|
||||
print('Payload: ${jwt.payload}');
|
||||
} on JWTExpiredError {
|
||||
} on JWTExpiredException {
|
||||
print('jwt expired');
|
||||
} on JWTError catch (ex) {
|
||||
} on JWTException catch (ex) {
|
||||
print(ex.message); // ex: invalid signature
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user