changed context from deprecated no context

This commit is contained in:
0xdcarns 2022-05-27 09:21:14 -04:00
parent 3cda73fe58
commit ed0f992142
3 changed files with 6 additions and 3 deletions

View file

@ -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())
}

View file

@ -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())
}

View file

@ -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())
}