add effective_role in the jwt custom claims
@@ -34,6 +34,7 @@ pub struct EnsureUser {
#[derive(Default, Deserialize, Serialize)]
pub struct CustomClaims {
pub tenant_id: Option<String>,
+ pub role: Option<String>,
pub ensure_user: Option<EnsureUser>,
}
@@ -41,6 +42,7 @@ impl CustomClaims {
pub fn new() -> Self {
CustomClaims {
tenant_id: None,
+ role: None,
ensure_user: None,
}
}
@@ -50,6 +52,11 @@ impl CustomClaims {
self
}
+ pub fn with_role(mut self, role: String) -> Self {
+ self.role = Some(role);
+ self
+ }
+
pub fn with_ensure_user(mut self, ensure_user: EnsureUser) -> Self {
self.ensure_user = Some(ensure_user);
self
