From 0e75d71a272da76c316fcc225a1f0c444b27db1b Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 11 Feb 2025 17:45:54 +0300 Subject: signin: promote well-known metadata endpoint path to a constant --- src/components/signin.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/signin.rs b/src/components/signin.rs index 53c3670..f2b5313 100644 --- a/src/components/signin.rs +++ b/src/components/signin.rs @@ -185,6 +185,8 @@ fn callback_handler(sender: AsyncComponentSender) -> impl Fn(&soup::Serv } impl SignIn { + const WELL_KNOWN_METADATA_ENDPOINT_PATH: &str = "/.well-known/oauth-authorization-server"; + pub fn scopes() -> kittybox_indieauth::Scopes { kittybox_indieauth::Scopes::new(vec![ kittybox_indieauth::Scope::Profile, @@ -211,7 +213,7 @@ impl SignIn { async fn well_known_metadata(http: soup::Session, url: glib::Uri) -> Option { let well_known = url.parse_relative( - "/.well-known/oauth-authorization-server", + Self::WELL_KNOWN_METADATA_ENDPOINT_PATH, glib::UriFlags::NONE ).unwrap(); // Speculatively check for metadata at the well-known path -- cgit 1.4.1