diff --git a/src/orangutan-server/src/main.rs b/src/orangutan-server/src/main.rs index a6138a1..ecfefe5 100644 --- a/src/orangutan-server/src/main.rs +++ b/src/orangutan-server/src/main.rs @@ -35,7 +35,7 @@ use crate::{ fn rocket() -> _ { let rocket = rocket::build() .mount("/", routes::routes()) - .register("/", catchers![unauthorized, not_found]) + .register("/", catchers![unauthorized, forbidden, not_found]) .manage(ObjectReader::new()) .attach(AdHoc::on_ignite("Tracing subsciber", |rocket| async move { let subscriber = FmtSubscriber::builder() @@ -86,6 +86,11 @@ async fn unauthorized() -> Result { not_found().await } +#[catch(403)] +async fn forbidden() -> &'static str { + "403 Forbidden. Token revoked." +} + /// TODO: Re-enable Basic authentication /// (`.raw_header("WWW-Authenticate", "Basic realm=\"This page is protected. Please log in.\"")`). #[catch(404)]