Skip to content

Commit

Permalink
Added moderator flag to jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Dec 11, 2023
1 parent 5befab9 commit 6e748a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct Session {
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
struct MyClaims {
affiliation: Option<String>,
moderator: Option<bool>,
}

impl AdditionalClaims for MyClaims {}
Expand Down
3 changes: 3 additions & 0 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ fn id_token_claims(
.picture()
.and_then(|x| x.get(None))
.map(|x| x.to_string()),
moderator: claims.additional_claims().moderator.clone(),
}))
}

Expand Down Expand Up @@ -276,6 +277,7 @@ async fn user_info_claims(
.picture()
.and_then(|x| x.get(None))
.map(|x| x.to_string()),
moderator: claims.additional_claims().moderator.clone(),
}))
}
Err(ConfigurationError::MissingUrl(_)) => Ok(None),
Expand Down Expand Up @@ -314,6 +316,7 @@ struct JitsiUser {
affiliation: Option<String>,
name: Option<String>,
avatar: Option<String>,
moderator: Option<bool>,
}

fn create_jitsi_jwt(
Expand Down

0 comments on commit 6e748a2

Please sign in to comment.