~vikanezrimaya/kittybox

6c1ebd115fff3e4dcda7c051ca71ccfec90342ec — Vika 2 months ago a16272f
chore: code cleanup in main.rs
1 files changed, 6 insertions(+), 8 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +6 -8
@@ 25,12 25,11 @@ async fn main() {
            std::process::exit(1);
        }
    };
    let token_endpoint: Url;
    match env::var("TOKEN_ENDPOINT") {
    let token_endpoint: Url = match env::var("TOKEN_ENDPOINT") {
        Ok(val) => {
            debug!("Token endpoint: {}", val);
            match Url::parse(&val) {
                Ok(val) => token_endpoint = val,
                Ok(val) => val,
                _ => {
                    error!("Token endpoint URL cannot be parsed, aborting.");
                    std::process::exit(1)


@@ 41,13 40,12 @@ async fn main() {
            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") {
    };
    let authorization_endpoint: Url = match env::var("AUTHORIZATION_ENDPOINT") {
        Ok(val) => {
            debug!("Auth endpoint: {}", val);
            match Url::parse(&val) {
                Ok(val) => authorization_endpoint = val,
                Ok(val) => val,
                _ => {
                    error!("Authorization endpoint URL cannot be parsed, aborting.");
                    std::process::exit(1)


@@ 58,7 56,7 @@ async fn main() {
            error!("AUTHORIZATION_ENDPOINT is not set, will not be able to confirm token and ID requests using IndieAuth!");
            std::process::exit(1)
        }
    }
    };

    //let internal_token: Option<String> = env::var("KITTYBOX_INTERNAL_TOKEN").ok();