Fix nil pointer exception in webfinger

Co-authoredjby: Jörn Dreyer <jdreyer@owncloud.com>
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2023-04-21 16:16:26 +02:00
parent e0b6ca0e29
commit 4a347e8c13
5 changed files with 30 additions and 2 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ func OidcAuth(opts ...Option) func(http.Handler) http.Handler {
// it will fetch the keys from the issuer using the .well-known
// endpoint
return goidc.NewProvider(
context.WithValue(context.Background(), oauth2.HTTPClient, http.Client{}),
context.WithValue(context.Background(), oauth2.HTTPClient, &opt.HttpClient),
opt.OidcIssuer,
)
}
@@ -65,7 +65,7 @@ func OidcAuth(opts ...Option) func(http.Handler) http.Handler {
}
userInfo, err := provider.UserInfo(
context.WithValue(ctx, oauth2.HTTPClient, http.Client{}),
context.WithValue(ctx, oauth2.HTTPClient, &opt.HttpClient),
oauth2.StaticTokenSource(oauth2Token),
)
if err != nil {