mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 12:46:49 +00:00
fix: Validate OAuth HTTPS redirect URIs are subdomains of the client domain
This commit is contained in:
1 parent
abf8f878bc
commit
dc03f2136a
1 file changed
+9
@@ -81,6 +81,15 @@ impl ClientMetadata {
|
||||
if !uri.username().is_empty() || uri.password().is_some() {
|
||||
return Err("HTTPS redirect URIs must not contain credentials.");
|
||||
}
|
||||
|
||||
if !uri
|
||||
.domain()
|
||||
.is_some_and(|domain| is_subdomain(domain, client_domain))
|
||||
{
|
||||
return Err(
|
||||
"All HTTPS redirect URIs must be subdomains of the client URI."
|
||||
);
|
||||
}
|
||||
},
|
||||
| "http" if self.application_type == ApplicationType::Native => {
|
||||
if uri
|
||||
|
||||
Reference in new issue
Block a user