aboutsummaryrefslogtreecommitdiff
path: root/routers/user/social.go
diff options
context:
space:
mode:
authorJustin Nuß <nuss.justin@gmail.com>2014-07-26 11:23:58 +0200
committerJustin Nuß <nuss.justin@gmail.com>2014-07-26 11:23:58 +0200
commit91480f3791f266369c343c539f8eeec245fa969a (patch)
treea03ad6062fe4b546367cdb6f9921399458d97441 /routers/user/social.go
parent835e85b5ce9921ffd4d50b90b706e02685167331 (diff)
parent35c75f06a0a4f321021984830d760e67ca0ef8e5 (diff)
Merge branch 'dev' of https://github.com/gogits/Gogs into issue/281
Conflicts: modules/base/tool.go
Diffstat (limited to 'routers/user/social.go')
-rw-r--r--routers/user/social.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/routers/user/social.go b/routers/user/social.go
index 9a56415f..ef83cd5b 100644
--- a/routers/user/social.go
+++ b/routers/user/social.go
@@ -11,8 +11,6 @@ import (
"net/url"
"strings"
- "github.com/go-martini/martini"
-
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
@@ -28,14 +26,14 @@ func extractPath(next string) string {
return n.Path
}
-func SocialSignIn(ctx *middleware.Context, params martini.Params) {
+func SocialSignIn(ctx *middleware.Context) {
if setting.OauthService == nil {
ctx.Handle(404, "social.SocialSignIn(oauth service not enabled)", nil)
return
}
next := extractPath(ctx.Query("next"))
- name := params["name"]
+ name := ctx.Params(":name")
connect, ok := social.SocialMap[name]
if !ok {
ctx.Handle(404, "social.SocialSignIn(social login not enabled)", errors.New(name))
@@ -81,7 +79,7 @@ func SocialSignIn(ctx *middleware.Context, params martini.Params) {
}
log.Trace("social.SocialSignIn(oa): %v", oa)
if err = models.AddOauth2(oa); err != nil {
- log.Error("social.SocialSignIn(add oauth2): %v", err) // 501
+ log.Error(4, "social.SocialSignIn(add oauth2): %v", err) // 501
return
}
case models.ErrOauth2NotAssociated: