From ed0f99214258654f6d751bb4950f1aeb970ba39b Mon Sep 17 00:00:00 2001 From: 0xdcarns Date: Fri, 27 May 2022 09:21:14 -0400 Subject: [PATCH] changed context from deprecated no context --- auth/azure-ad.go | 3 ++- auth/github.go | 3 ++- auth/google.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/auth/azure-ad.go b/auth/azure-ad.go index 8f6f32b6..f828d3bc 100644 --- a/auth/azure-ad.go +++ b/auth/azure-ad.go @@ -1,6 +1,7 @@ package auth import ( + "context" "encoding/json" "fmt" "io" @@ -90,7 +91,7 @@ func getAzureUserInfo(state string, code string) (*azureOauthUser, error) { if state != oauth_state_string { return nil, fmt.Errorf("invalid oauth state") } - var token, err = auth_provider.Exchange(oauth2.NoContext, code) + var token, err = auth_provider.Exchange(context.Background(), code) if err != nil { return nil, fmt.Errorf("code exchange failed: %s", err.Error()) } diff --git a/auth/github.go b/auth/github.go index 9e45c869..dfb98241 100644 --- a/auth/github.go +++ b/auth/github.go @@ -1,6 +1,7 @@ package auth import ( + "context" "encoding/json" "fmt" "io" @@ -90,7 +91,7 @@ func getGithubUserInfo(state string, code string) (*githubOauthUser, error) { if state != oauth_state_string { return nil, fmt.Errorf("invalid OAuth state") } - var token, err = auth_provider.Exchange(oauth2.NoContext, code) + var token, err = auth_provider.Exchange(context.Background(), code) if err != nil { return nil, fmt.Errorf("code exchange failed: %s", err.Error()) } diff --git a/auth/google.go b/auth/google.go index 401b21c1..4397ccaf 100644 --- a/auth/google.go +++ b/auth/google.go @@ -1,6 +1,7 @@ package auth import ( + "context" "encoding/json" "fmt" "io" @@ -91,7 +92,7 @@ func getGoogleUserInfo(state string, code string) (*googleOauthUser, error) { if state != oauth_state_string { return nil, fmt.Errorf("invalid OAuth state") } - var token, err = auth_provider.Exchange(oauth2.NoContext, code) + var token, err = auth_provider.Exchange(context.Background(), code) if err != nil { return nil, fmt.Errorf("code exchange failed: %s", err.Error()) }