Skip to content

Commit

Permalink
Fix public api for domains with path prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
FDHoho007 committed Apr 27, 2024
1 parent 0fe93ed commit e7314dd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/api/core/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit e7314dd

Please sign in to comment.