Skip to content

Commit 321ac5f

Browse files
authored
Fix formatting of paths in OIDC module
1 parent 37a044b commit 321ac5f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/webserver/oidc.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,23 @@ impl TryFrom<&AppConfig> for OidcConfig {
102102
let logout_uri = format!("{site_prefix_trimmed}{SQLPAGE_LOGOUT_URI}");
103103

104104
for path in &mut protected_paths {
105+
// Ensure the path starts with "/"
106+
if !path.starts_with('/') {
107+
path.insert(0, '/');
108+
}
109+
// Prefix with site_prefix_trimmed
105110
*path = format!("{}{}", site_prefix_trimmed, path);
106111
}
107112

108-
for path in &mut public_paths{
113+
for path in &mut public_paths {
114+
// Ensure the path starts with "/"
115+
if !path.starts_with('/') {
116+
path.insert(0, '/');
117+
}
118+
// Prefix with site_prefix_trimmed
109119
*path = format!("{}{}", site_prefix_trimmed, path);
110120
}
111-
121+
112122
Ok(Self {
113123
issuer_url: issuer_url.clone(),
114124
client_id: config.oidc_client_id.clone(),

0 commit comments

Comments
 (0)