File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
crates/handlers/src/admin Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,13 @@ fn oauth_security_scheme(url_builder: Option<&UrlBuilder>) -> SecurityScheme {
102
102
url_builder. oauth_token_endpoint ( ) . to_string ( ) ,
103
103
)
104
104
} else {
105
+ // This is a dirty fix for Swagger UI: when it joins the URLs with the
106
+ // base URL, if the path starts with a slash, it will go to the root of
107
+ // the domain instead of the API root.
108
+ // It works if we make it explicitly relative
105
109
(
106
- OAuth2AuthorizationEndpoint :: PATH . to_owned ( ) ,
107
- OAuth2TokenEndpoint :: PATH . to_owned ( ) ,
110
+ format ! ( ".{}" , OAuth2AuthorizationEndpoint :: PATH ) ,
111
+ format ! ( ".{}" , OAuth2TokenEndpoint :: PATH ) ,
108
112
)
109
113
} ;
110
114
Original file line number Diff line number Diff line change 2527
2527
"type" : " oauth2" ,
2528
2528
"flows" : {
2529
2529
"clientCredentials" : {
2530
- "refreshUrl" : " /oauth2/token" ,
2531
- "tokenUrl" : " /oauth2/token" ,
2530
+ "refreshUrl" : " . /oauth2/token" ,
2531
+ "tokenUrl" : " . /oauth2/token" ,
2532
2532
"scopes" : {
2533
2533
"urn:mas:admin" : " Grant access to the admin API"
2534
2534
}
2535
2535
},
2536
2536
"authorizationCode" : {
2537
- "authorizationUrl" : " /authorize" ,
2538
- "tokenUrl" : " /oauth2/token" ,
2539
- "refreshUrl" : " /oauth2/token" ,
2537
+ "authorizationUrl" : " . /authorize" ,
2538
+ "tokenUrl" : " . /oauth2/token" ,
2539
+ "refreshUrl" : " . /oauth2/token" ,
2540
2540
"scopes" : {
2541
2541
"urn:mas:admin" : " Grant access to the admin API"
2542
2542
}
You can’t perform that action at this time.
0 commit comments