Skip to content

Commit aebdf0b

Browse files
rrwang7Convex, Inc.
authored andcommitted
fix custom claims (#28500)
GitOrigin-RevId: da9e9ea5a1492f195c89057c50e99169c83d022c
1 parent fc1ddd9 commit aebdf0b

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/keybroker/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ rsa = { workspace = true, optional = true }
2828
serde = { workspace = true }
2929
sodiumoxide = { workspace = true }
3030
sync_types = { package = "convex_sync_types", path = "../convex/sync_types" }
31+
tracing = { workspace = true }
3132

3233
[dev-dependencies]
3334
common = { path = "../common", features = ["testing"] }

crates/keybroker/src/broker.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,17 @@ impl UserIdentity {
450450
continue;
451451
},
452452
_ => {
453-
let value = claim.1.as_str().context("Only string values for custom claims are supported")?.to_string();
454-
custom_claims.insert(claim.0.to_string(), value);
453+
match claim.1.as_str() {
454+
Some(value) => {
455+
custom_claims.insert(claim.0.to_string(), value.to_string());
456+
},
457+
None => {
458+
tracing::warn!(
459+
"Only string values for custom claims are supported. Skipping claim: {}",
460+
claim.0
461+
);
462+
},
463+
}
455464
},
456465
}
457466
}

0 commit comments

Comments
 (0)