From 336a9efa46dd54749915fd71ee8916982d0c8c8b Mon Sep 17 00:00:00 2001 From: Travis Johnson Date: Thu, 25 May 2023 23:50:29 -0400 Subject: [PATCH] sync.Once can't be copied, needs pointer receiver --- auth/jwt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/jwt.go b/auth/jwt.go index ced9375a..5bcf3cb8 100644 --- a/auth/jwt.go +++ b/auth/jwt.go @@ -23,11 +23,11 @@ type JWTAuth struct { Claim string `json:"claim"` Header string `json:"header"` remoteKeySet *oidc.RemoteKeySet - init *sync.Once + init sync.Once } // Auth authenticates the user via a JWT token in an HTTP header. -func (a JWTAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error) { +func (a *JWTAuth) Auth(r *http.Request, usr users.Store, stg *settings.Settings, srv *settings.Server) (*users.User, error) { a.init.Do(func() { a.remoteKeySet = oidc.NewRemoteKeySet(context.Background(), a.CertsURL) })