From e164f26fa5424339a8caafd357517da1317da53b Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 6 Oct 2020 11:50:57 -0400 Subject: [PATCH] auth/middleware: fix printf suspension params --- auth/middleware.go | 8 ++++---- go.sum | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/auth/middleware.go b/auth/middleware.go index 7b147be5cf96732ba85fb04255959174473531d8..728b8c031bdce1082c228c558be12cc29584f855 100644 --- a/auth/middleware.go +++ b/auth/middleware.go @@ -139,7 +139,7 @@ func authForUsername(ctx context.Context, username string) (*AuthContext, error) if auth.UserType == USER_SUSPENDED { return nil, fmt.Errorf( "Account suspended with the following notice: %s\nContact support", - auth.SuspensionNotice) + *auth.SuspensionNotice) } return &auth, nil @@ -198,7 +198,7 @@ func authForOAuthClient(ctx context.Context, clientUUID string) (*AuthContext, e if auth.UserType == USER_SUSPENDED { return nil, fmt.Errorf( "Account suspended with the following notice: %s\nContact support", - auth.SuspensionNotice) + *auth.SuspensionNotice) } return &auth, nil @@ -530,7 +530,7 @@ func OAuth2(token string, hash [64]byte, w http.ResponseWriter, if auth.UserType == USER_SUSPENDED { authError(w, fmt.Sprintf( "Account suspended with the following notice: %s\nContact support", - auth.SuspensionNotice), http.StatusForbidden) + *auth.SuspensionNotice), http.StatusForbidden) return } @@ -640,7 +640,7 @@ func LegacyOAuth(bearer string, hash [64]byte, w http.ResponseWriter, if auth.UserType == USER_SUSPENDED { authError(w, fmt.Sprintf( "Account suspended with the following notice: %s\nContact support", - auth.SuspensionNotice), http.StatusForbidden) + *auth.SuspensionNotice), http.StatusForbidden) return } diff --git a/go.sum b/go.sum index 1aadf6f51d411b1420128f9f6c3dfea8c2df19f2..f065687c2940bb30ddd5acd5dd5b5fc0503dd3b6 100644 --- a/go.sum +++ b/go.sum @@ -29,6 +29,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=