diff options
author | skyblue <ssx205@gmail.com> | 2014-04-12 09:42:09 +0800 |
---|---|---|
committer | skyblue <ssx205@gmail.com> | 2014-04-12 09:42:09 +0800 |
commit | 5c1312f38e8968e068125a1b1dd59060f3f29bfe (patch) | |
tree | 92f442d78974645e98465de73679d3e163f681bb /routers/user/user.go | |
parent | 4c6e0e94995b95d3493c6641fbb5a528c6d6c134 (diff) | |
download | gitea-5c1312f38e8968e068125a1b1dd59060f3f29bfe.tar.gz gitea-5c1312f38e8968e068125a1b1dd59060f3f29bfe.zip |
clean oauth2 code
Diffstat (limited to 'routers/user/user.go')
-rw-r--r-- | routers/user/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index 253ab7be00..8585267a64 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -82,7 +82,6 @@ func SignIn(ctx *middleware.Context) { ctx.Data["OauthGitHubEnabled"] = base.OauthService.GitHub.Enabled } - var user *models.User // Check auto-login. userName := ctx.GetCookie(base.CookieUserName) if len(userName) == 0 { @@ -91,7 +90,6 @@ func SignIn(ctx *middleware.Context) { } isSucceed := false - var err error defer func() { if !isSucceed { log.Trace("%s auto-login cookie cleared: %s", ctx.Req.RequestURI, userName) @@ -101,7 +99,7 @@ func SignIn(ctx *middleware.Context) { } }() - user, err = models.GetUserByName(userName) + user, err := models.GetUserByName(userName) if err != nil { ctx.HTML(500, "user/signin") return @@ -181,6 +179,8 @@ func SignOut(ctx *middleware.Context) { ctx.Session.Delete("userId") ctx.Session.Delete("userName") ctx.Session.Delete("socialId") + ctx.Session.Delete("socialName") + ctx.Session.Delete("socialEmail") ctx.SetCookie(base.CookieUserName, "", -1) ctx.SetCookie(base.CookieRememberName, "", -1) ctx.Redirect("/") |