Skip to content

Commit c9c8cab

Browse files
committed
Lint fixes
1 parent 0a9b71e commit c9c8cab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oauth/oauth.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func getTokenFromWeb(ctx context.Context, config *oauth2.Config) (*oauth2.Token,
165165
authCodeURL := config.AuthCodeURL(authReqState.String(), oauth2.AccessTypeOffline, oauth2.ApprovalForce)
166166

167167
// root handler: /
168-
r.Get("/", func(w http.ResponseWriter, req *http.Request) {
168+
r.Get("/", func(w http.ResponseWriter, _ *http.Request) {
169169
w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0")
170170
w.Header().Set("Pragma", "no-cache")
171171
w.Header().Set("Expires", "0")
@@ -185,9 +185,11 @@ func getTokenFromWeb(ctx context.Context, config *oauth2.Config) (*oauth2.Token,
185185

186186
if receivedState := req.URL.Query().Get("state"); receivedState != authReqState.String() {
187187
w.WriteHeader(http.StatusBadRequest)
188+
188189
if err := t.ExecuteTemplate(w, "failure.html", map[string]any{"error": ErrInvalidCallbackState}); err != nil {
189190
logger.Error().Msgf("template execution failed: %v", err)
190191
}
192+
191193
close(tokChan)
192194

193195
return

0 commit comments

Comments
 (0)