Commit 1b6261a586717206dd509f44b438fe6d3c0649f4

Parents: 36178298a2935988b79ace86fbba96d355dd6dce

From: Moritz Poldrack <git@moritz.sh>
Date: Thu Jan 11 20:36:51 2024 +0700

lint: make golangci-lint happy

		

Stats

configuration.go +7/-6

Changeset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/configuration.go b/configuration.go
index 1a9bf7c13a26612c16fbe9e7dfc8803f05c0eb15..b9e6913340b43aeae0ae306bc950657e091a5219 100644
--- a/configuration.go
+++ b/configuration.go
@@ -20,10 +20,9 @@
 // Configuration wraps an OIDC service
 type Configuration struct {
 	// autofilled configuration
-	cfg         *wellKnownFile
-	callbackURL string
-	oauthCfg    *oauth2.Config
-	scopes      []string
+	cfg      *wellKnownFile
+	oauthCfg *oauth2.Config
+	scopes   []string
 
 	// validators
 	validators    map[string]*validator
@@ -67,8 +66,10 @@ 		return nil, fmt.Errorf("failed to parse config: %w", err)
 	}
 
 	jwkcache := jwk.NewCache(context.Background())
-	jwkcache.Register(cfg.JwksURI)
-	if _, err := jwkcache.Refresh(context.Background(), cfg.JwksURI); err != nil {
+	if err = jwkcache.Register(cfg.JwksURI); err != nil {
+		return nil, fmt.Errorf("failed to register JWKs: %w", err)
+	}
+	if _, err = jwkcache.Refresh(context.Background(), cfg.JwksURI); err != nil {
 		return nil, fmt.Errorf("failed to get JWKs: %w", err)
 	}