feat: v1.13.17, claim support mutiple times
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -606,7 +606,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "card-cli"
|
name = "card-cli"
|
||||||
version = "1.13.16"
|
version = "1.13.17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm-stream",
|
"aes-gcm-stream",
|
||||||
"authenticator 0.3.1",
|
"authenticator 0.3.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "card-cli"
|
name = "card-cli"
|
||||||
version = "1.13.16"
|
version = "1.13.17"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,23 @@ pub fn build_jwt_parts(
|
|||||||
warning!("Claim '{}' do not contains ':'", claim);
|
warning!("Claim '{}' do not contains ':'", claim);
|
||||||
}
|
}
|
||||||
Some((k, v)) => {
|
Some((k, v)) => {
|
||||||
jwt_claims.insert(k, v);
|
match jwt_claims.get_mut(&k) {
|
||||||
|
None => { jwt_claims.insert(k, v); },
|
||||||
|
Some(val) => {
|
||||||
|
match val {
|
||||||
|
Value::Array(arr) => {
|
||||||
|
arr.push(v);
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
let mut arr = vec![];
|
||||||
|
arr.push(val.clone());
|
||||||
|
arr.push(v);
|
||||||
|
jwt_claims.insert(k, Value::Array(arr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// jwt_claims.insert(k, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user