Compare commits

...

2 Commits

Author SHA1 Message Date
FDHoho007 3987d5b0a1
Merge 86fbb1363d into 2ad33ec97f 2024-04-27 15:37:33 +02:00
FDHoho007 86fbb1363d Fix public api for domains with path prefix 2024-04-27 15:37:30 +02:00
1 changed files with 2 additions and 6 deletions

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");
}