We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a71006 commit a9424d2Copy full SHA for a9424d2
1 file changed
internal/api/oauthserver/handlers.go
@@ -233,11 +233,14 @@ type OAuthServerMetadataResponse struct {
233
func (s *Server) OAuthServerMetadata(w http.ResponseWriter, r *http.Request) error {
234
issuer := s.config.JWT.Issuer
235
236
- // TODO(cemal) :: Remove this check when we have the config validation in place
+ // Basic issuer validation - empty issuer would create broken URLs
237
if issuer == "" {
238
return apierrors.NewInternalServerError("Issuer is not set")
239
}
240
241
+ // Ensure issuer doesn't end with a slash to avoid double slashes in URLs
242
+ issuer = strings.TrimSuffix(issuer, "/")
243
+
244
response := OAuthServerMetadataResponse{
245
Issuer: issuer,
246
AuthorizationEndpoint: fmt.Sprintf("%s/oauth/authorize", issuer),
0 commit comments