From 29d4d93019ff414f6989d85095d8bd882c95e217 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 17 May 2019 11:57:15 +0800 Subject: [PATCH] =?UTF-8?q?:mute:=20=E5=87=8F=E5=B0=91=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/oauthctl.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/session/oauthctl.go b/session/oauthctl.go index 47eadde..1706523 100644 --- a/session/oauthctl.go +++ b/session/oauthctl.go @@ -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.