about summary refs log tree commit diff
path: root/kittybox-rs
diff options
context:
space:
mode:
Diffstat (limited to 'kittybox-rs')
-rw-r--r--kittybox-rs/src/main.rs43
1 files changed, 7 insertions, 36 deletions
diff --git a/kittybox-rs/src/main.rs b/kittybox-rs/src/main.rs
index 7a363b8..fcfc135 100644
--- a/kittybox-rs/src/main.rs
+++ b/kittybox-rs/src/main.rs
@@ -1,7 +1,6 @@
 use kittybox::database::FileStorage;
 use std::{env, time::Duration};
 use tracing::{debug, error, info};
-use url::Url;
 
 #[tokio::main]
 async fn main() {
@@ -24,40 +23,6 @@ async fn main() {
         }
     };
 
-    let token_endpoint: Url = match env::var("TOKEN_ENDPOINT") {
-        Ok(val) => {
-            debug!("Token endpoint: {}", val);
-            match Url::parse(&val) {
-                Ok(val) => val,
-                _ => {
-                    error!("Token endpoint URL cannot be parsed, aborting.");
-                    std::process::exit(1)
-                }
-            }
-        }
-        Err(_) => {
-            error!("TOKEN_ENDPOINT is not set, will not be able to authorize users!");
-            std::process::exit(1)
-        }
-    };
-
-    let authorization_endpoint: Url = match env::var("AUTHORIZATION_ENDPOINT") {
-        Ok(val) => {
-            debug!("Auth endpoint: {}", val);
-            match Url::parse(&val) {
-                Ok(val) => val,
-                _ => {
-                    error!("Authorization endpoint URL cannot be parsed, aborting.");
-                    std::process::exit(1)
-                }
-            }
-        }
-        Err(_) => {
-            error!("AUTHORIZATION_ENDPOINT is not set, will not be able to confirm token and ID requests using IndieAuth!");
-            std::process::exit(1)
-        }
-    };
-
     let listen_at = match env::var("SERVE_AT")
         .ok()
         .unwrap_or_else(|| "[::]:8080".to_string())
@@ -190,7 +155,13 @@ async fn main() {
             .merge(media)
             //.merge(indieauth)
             .merge(technical)
-            .layer(axum::Extension(kittybox::tokenauth::TokenEndpoint(token_endpoint)))
+            .layer(
+                axum::Extension(
+                    kittybox::tokenauth::TokenEndpoint(
+                        "https://tokens.indieauth.com/token".parse().unwrap()
+                    )
+                )
+            )
             .layer(tower::ServiceBuilder::new()
                    .layer(tower_http::trace::TraceLayer::new_for_http())
                    .into_inner())