Applied suggested linter changes
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
@ -57,14 +58,14 @@ func InstallFacebookAuth(app *aero.Application) {
|
||||
}
|
||||
|
||||
// Handle the exchange code to initiate a transport
|
||||
token, err := config.Exchange(oauth2.NoContext, ctx.Query("code"))
|
||||
token, err := config.Exchange(context.Background(), ctx.Query("code"))
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusBadRequest, "Could not obtain OAuth token", err)
|
||||
}
|
||||
|
||||
// Construct the OAuth client
|
||||
client := config.Client(oauth2.NoContext, token)
|
||||
client := config.Client(context.Background(), token)
|
||||
|
||||
// Fetch user data from Facebook
|
||||
resp, err := client.Get("https://graph.facebook.com/me?fields=email,first_name,last_name,gender")
|
||||
|
Reference in New Issue
Block a user