fix: Don't crash when the client URL doesn't have a domain

Having a URL with an IP literal, for example, is allowed
This commit is contained in:
Jade Ellis 2025-05-10 14:24:24 +01:00
parent c1bad98702
commit 168c21bb27
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ pub(crate) async fn authorize(
.well_known .well_known
.client .client
.as_ref() .as_ref()
.map(|s| s.domain().expect("well-known client should be a domain")); .map(|s| s.host_str().expect("well-known client should have a host"));
let hostname = hostname.unwrap_or("Continuwuity"); let hostname = hostname.unwrap_or("Continuwuity");
match oauth.authorization_header() { match oauth.authorization_header() {
| None => { | None => {

View file

@ -47,7 +47,7 @@ pub(crate) async fn oidc_login(
.well_known .well_known
.client .client
.as_ref() .as_ref()
.map(|s| s.domain().expect("well-known client should have a domain")); .map(|s| s.host_str().expect("well-known client should have a host"));
let hostname = hostname.unwrap_or("Continuwuity"); let hostname = hostname.unwrap_or("Continuwuity");
let authorization_query: AuthorizationQuery = query.into(); let authorization_query: AuthorizationQuery = query.into();