🔇 减少日志

This commit is contained in:
Liang Ding 2019-05-17 11:57:15 +08:00
parent 359ce01227
commit 29d4d93019
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
1 changed files with 0 additions and 7 deletions

View File

@ -66,15 +66,10 @@ func RedirectGitHubHandler(w http.ResponseWriter, r *http.Request) {
state := util.Rand.String(16) + referer
states[state] = state
path := loginAuthURL + "?client_id=" + clientId + "&state=" + state + "&scope=public_repo,read:user,user:follow"
logger.Infof("redirect to github [" + path + "]")
http.Redirect(w, r, path, http.StatusSeeOther)
}
func GithubCallbackHandler(w http.ResponseWriter, r *http.Request) {
logger.Infof("Github callback [" + r.URL.String() + "]")
state := r.URL.Query().Get("state")
if _, exist := states[state]; !exist {
http.Error(w, "Get state param failed", http.StatusBadRequest)
@ -120,8 +115,6 @@ func GithubCallbackHandler(w http.ResponseWriter, r *http.Request) {
httpSession.Values["id"] = strconv.Itoa(rand.Int())
httpSession.Options.MaxAge = conf.Wide.HTTPSessionMaxAge
httpSession.Save(r, w)
logger.Debugf("Created a HTTP session [%s] for user [%s]", httpSession.Values["id"].(string), githubId)
}
// GitHubUserInfo returns GitHub user info specified by the given access token.