<commit_before>package handlers

import (
	"encoding/json"
	"net/http"

	log "github.com/Sirupsen/logrus"
	strava "github.com/strava/go.strava"
	"gopkg.in/gin-gonic/gin.v1"
)

// StravaAuth will render a request to authorize strava user with Bestrida
func StravaAuth(c *gin.Context) {
	c.JSON(200, map[string]interface{}{
		"ID":     clientID,
		"SECRET": clientSecret,
	})
}

func oAuthSuccess(auth *strava.AuthorizationResponse, w http.ResponseWriter, r *http.Request) {
	log.Info("SUCCESS: At this point you can use this information to create a new user or link the account to one of your existing users")
	log.WithField("State", auth.State).Info("State Returned From Strava")
	log.WithField("Access Token", auth.AccessToken).Info("Strava Access Token")

	log.Info("The Authenticated Athlete (you): ")
	content, _ := json.MarshalIndent(auth.Athlete, "", " ")
	log.WithField("Content", content).Info("Content From Strava")
}

func oAuthFailure(err error, w http.ResponseWriter, r *http.Request) {
	log.Error("Authorization Failure: ")

	// some standard error checking
	if err == strava.OAuthAuthorizationDeniedErr {
		log.WithError(err).Error("The user clicked the 'Do not Authorize' button on the previous page.")
		log.WithError(err).Error("This is the main error your application should handle.")
	} else if err == strava.OAuthInvalidCredentialsErr {
		log.WithError(err).Error("You provided an incorrect client_id or client_secret.")
		log.WithError(err).Error("Did you remember to set them at the beginning of this file?")
	} else if err == strava.OAuthInvalidCodeErr {
		log.WithError(err).Error("The temporary token was not recognized, this shouldn't happen normally")
	} else if err == strava.OAuthServerErr {
		log.WithError(err).Error("There was some sort of server error, try again to see if the problem continues")
	} else {
		log.WithError(err).Error("Unknown Error Authorizing")
	}
}<commit_msg>remove redunant logging<commit_after>package handlers

import (
	"encoding/json"
	"net/http"

	log "github.com/Sirupsen/logrus"
	strava "github.com/strava/go.strava"
	"gopkg.in/gin-gonic/gin.v1"
)

// StravaAuth will render a request to authorize strava user with Bestrida
func StravaAuth(c *gin.Context) {
	c.JSON(200, map[string]interface{}{
		"ID":     clientID,
		"SECRET": clientSecret,
	})
}

func oAuthSuccess(auth *strava.AuthorizationResponse, w http.ResponseWriter, r *http.Request) {
	log.Info("SUCCESS: At this point you can use this information to create a new user or link the account to one of your existing users")
	log.WithField("State", auth.State).Info("State Returned From Strava")
	log.WithField("Access Token", auth.AccessToken).Info("Strava Access Token")

	log.Info("The Authenticated Athlete (you): ")
	content, _ := json.MarshalIndent(auth.Athlete, "", " ")
	log.WithField("Content", content).Info("Content From Strava")
}

func oAuthFailure(err error, w http.ResponseWriter, r *http.Request) {
	log.Error("Authorization Failure: ")

	// some standard error checking
	if err == strava.OAuthAuthorizationDeniedErr {
		log.WithError(err).Error("The user clicked the 'Do not Authorize' button on the previous page.")
	} else {
		log.WithError(err).Error("Unknown Error Authorizing with Strava")
	}
}
{'fraction_non_alphanumeric': 0.12461348175633889, 'fraction_numerical': 0.0024737167594310453, 'mean_word_length': 5.001855287569573, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4509008', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1045, 'n_words': 295}