Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit 6e748a2

Browse files
committed
Added moderator flag to jwt
1 parent 5befab9 commit 6e748a2

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

Cargo.lock

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

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct Session {
4848
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
4949
struct MyClaims {
5050
affiliation: Option<String>,
51+
moderator: Option<bool>,
5152
}
5253

5354
impl AdditionalClaims for MyClaims {}

src/routes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ fn id_token_claims(
246246
.picture()
247247
.and_then(|x| x.get(None))
248248
.map(|x| x.to_string()),
249+
moderator: claims.additional_claims().moderator.clone(),
249250
}))
250251
}
251252

@@ -276,6 +277,7 @@ async fn user_info_claims(
276277
.picture()
277278
.and_then(|x| x.get(None))
278279
.map(|x| x.to_string()),
280+
moderator: claims.additional_claims().moderator.clone(),
279281
}))
280282
}
281283
Err(ConfigurationError::MissingUrl(_)) => Ok(None),
@@ -314,6 +316,7 @@ struct JitsiUser {
314316
affiliation: Option<String>,
315317
name: Option<String>,
316318
avatar: Option<String>,
319+
moderator: Option<bool>,
317320
}
318321

319322
fn create_jitsi_jwt(

0 commit comments

Comments
 (0)