Improved code readability

This commit is contained in:
2019-03-04 11:33:08 +09:00
parent c42b66bdcc
commit 44f3354729
3 changed files with 14 additions and 10 deletions

View File

@ -77,14 +77,14 @@ func InstallFacebookAuth(app *aero.Application) {
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")
response, err := client.Get("https://graph.facebook.com/me?fields=email,first_name,last_name,gender")
if err != nil {
return ctx.Error(http.StatusBadRequest, "Failed requesting user data from Facebook", err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
defer response.Body.Close()
body, _ := ioutil.ReadAll(response.Body)
// Construct a FacebookUser object
fbUser := FacebookUser{}