~boringcactus/gemifedi

36fbc0676bdee1633bccd200e9b772945a69dfc2 — Melody Horn 1 year, 2 months ago 9e46c95
tidy up auth process a bit
1 files changed, 1 insertions(+), 2 deletions(-)

M src/mastodon_util.rs
M src/mastodon_util.rs => src/mastodon_util.rs +1 -2
@@ 35,10 35,9 @@ pub fn get_app_install(domain: &str) -> Registered<elefren::http_send::HttpSende
        let file_data = fs::read(&data_path).unwrap();
        let install: AppInstall = toml::from_slice(file_data.as_slice()).unwrap();
        let (base, client_id, client_secret, redirect, scopes, force_login) = install.parts;
        dbg!(&scopes, &scopes_needed);
        if scopes != scopes_needed {
            // we don't have the scopes we need, so re-register on this domain
            let _ = fs::remove_file(data_path);
            fs::remove_file(data_path).unwrap();
            return get_app_install(domain);
        }
        Registered::from_parts(&base, &client_id, &client_secret, &redirect, scopes, force_login)