0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-11-14 22:12:03 +01:00

Fix public api for domains with path prefix

This commit is contained in:
FDHoho007 2024-04-12 22:31:42 +02:00
parent e1a8df96db
commit f4c5451e75
No known key found for this signature in database
GPG key ID: A1AF3B446E1057E0

View file

@ -216,12 +216,8 @@ impl<'r> FromRequest<'r> for PublicToken {
if time_now > claims.exp {
err_handler!("Token expired");
}
// Check if claims.iss is host|claims.scope[0]
let host = match auth::Host::from_request(request).await {
Outcome::Success(host) => host,
_ => err_handler!("Error getting Host"),
};
let complete_host = format!("{}|{}", host.host, claims.scope[0]);
// Check if claims.iss is domain|claims.scope[0]
let complete_host = format!("{}|{}", CONFIG.domain_origin(), claims.scope[0]);
if complete_host != claims.iss {
err_handler!("Token not issued by this server");
}