mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 18:55:57 +03:00
improve admin invite (#5403)
* check for admin invite * refactor the invitation logic * cleanup check for undefined token * prevent wrong user from accepting invitation
This commit is contained in:
@@ -194,16 +194,16 @@ pub struct InviteJwtClaims {
|
||||
pub sub: UserId,
|
||||
|
||||
pub email: String,
|
||||
pub org_id: Option<OrganizationId>,
|
||||
pub member_id: Option<MembershipId>,
|
||||
pub org_id: OrganizationId,
|
||||
pub member_id: MembershipId,
|
||||
pub invited_by_email: Option<String>,
|
||||
}
|
||||
|
||||
pub fn generate_invite_claims(
|
||||
user_id: UserId,
|
||||
email: String,
|
||||
org_id: Option<OrganizationId>,
|
||||
member_id: Option<MembershipId>,
|
||||
org_id: OrganizationId,
|
||||
member_id: MembershipId,
|
||||
invited_by_email: Option<String>,
|
||||
) -> InviteJwtClaims {
|
||||
let time_now = Utc::now();
|
||||
|
Reference in New Issue
Block a user