mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 13:17:43 +02:00
Fix org invite url being html encoded (#5100)
Ever since we changed to pass the full url as a template value handlebars now html-encodes this. This causes issues with the plain/text mails, but it also could potentially cause issues with the text/html templates. This PR encloses the template values inside triple braces `{{{ }}}` which prevents html-encoding. Since the URL is generated via the `url` crate the values are percent-encoded anyway. Fixes #5097 Signed-off-by: BlackDex <black.dex@gmail.com>
This commit is contained in:

committed by
GitHub

parent
65629a99f0
commit
a47b484172
@ -872,20 +872,19 @@ async fn send_invite(org_id: &str, data: Json<InviteData>, headers: AdminHeaders
|
||||
}
|
||||
|
||||
for email in data.emails.iter() {
|
||||
let email = email.to_lowercase();
|
||||
let mut user_org_status = UserOrgStatus::Invited as i32;
|
||||
let user = match User::find_by_mail(&email, &mut conn).await {
|
||||
let user = match User::find_by_mail(email, &mut conn).await {
|
||||
None => {
|
||||
if !CONFIG.invitations_allowed() {
|
||||
err!(format!("User does not exist: {email}"))
|
||||
}
|
||||
|
||||
if !CONFIG.is_email_domain_allowed(&email) {
|
||||
if !CONFIG.is_email_domain_allowed(email) {
|
||||
err!("Email domain not eligible for invitations")
|
||||
}
|
||||
|
||||
if !CONFIG.mail_enabled() {
|
||||
let invitation = Invitation::new(&email);
|
||||
let invitation = Invitation::new(email);
|
||||
invitation.save(&mut conn).await?;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user