1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-04 02:18:00 +01:00

Remove whitespace before processing tokens

Dieser Commit ist enthalten in:
Daniel García 2019-01-07 20:37:14 +01:00
Ursprung 21b85b78b1
Commit 50eeb4f651
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: FC8A7D14C3CD543A
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -51,7 +51,9 @@ pub fn decode_jwt(token: &str) -> Result<JWTClaims, Error> {
algorithms: vec![JWT_ALGORITHM], algorithms: vec![JWT_ALGORITHM],
}; };
jsonwebtoken::decode(token, &PUBLIC_RSA_KEY, &validation) let token = token.replace(char::is_whitespace, "");
jsonwebtoken::decode(&token, &PUBLIC_RSA_KEY, &validation)
.map(|d| d.claims) .map(|d| d.claims)
.map_res("Error decoding login JWT") .map_res("Error decoding login JWT")
} }
@ -68,7 +70,9 @@ pub fn decode_invite_jwt(token: &str) -> Result<InviteJWTClaims, Error> {
algorithms: vec![JWT_ALGORITHM], algorithms: vec![JWT_ALGORITHM],
}; };
jsonwebtoken::decode(token, &PUBLIC_RSA_KEY, &validation) let token = token.replace(char::is_whitespace, "");
jsonwebtoken::decode(&token, &PUBLIC_RSA_KEY, &validation)
.map(|d| d.claims) .map(|d| d.claims)
.map_res("Error decoding invite JWT") .map_res("Error decoding invite JWT")
} }

Datei anzeigen

@ -78,7 +78,8 @@ pub fn send_invite(
format!( format!(
"<html> "<html>
<p>You have been invited to join the <b>{}</b> organization.<br><br> <p>You have been invited to join the <b>{}</b> organization.<br><br>
<a href=\"{}/#/accept-organization/?organizationId={}&organizationUserId={}&email={}&organizationName={}&token={}\">Click here to join</a></p> <a href=\"{}/#/accept-organization/?organizationId={}&organizationUserId={}&email={}&organizationName={}&token={}\">
Click here to join</a></p>
<p>If you do not wish to join this organization, you can safely ignore this email.</p> <p>If you do not wish to join this organization, you can safely ignore this email.</p>
</html>", </html>",
org_name, CONFIG.domain, org_id.unwrap_or("_".to_string()), org_user_id.unwrap_or("_".to_string()), address, org_name, invite_token org_name, CONFIG.domain, org_id.unwrap_or("_".to_string()), org_user_id.unwrap_or("_".to_string()), address, org_name, invite_token