summaryrefslogtreecommitdiffstats
path: root/routers/user/social.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-07 12:56:40 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-07 12:56:40 -0400
commit9ea9818d3255e5b08293205e278240dece36687d (patch)
tree51c6a65586843082f451ee1e93082fec5784ccd2 /routers/user/social.go
parent05fb34eacdbec59fb8bcdf96c82c0855e6ec78d2 (diff)
downloadgitea-9ea9818d3255e5b08293205e278240dece36687d.tar.gz
gitea-9ea9818d3255e5b08293205e278240dece36687d.zip
Fix issue with log in with GitHub but need more error handle after
Diffstat (limited to 'routers/user/social.go')
-rw-r--r--routers/user/social.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/routers/user/social.go b/routers/user/social.go
index f5577d809b..08cfcd83f2 100644
--- a/routers/user/social.go
+++ b/routers/user/social.go
@@ -1,20 +1,20 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
+
package user
import (
"encoding/json"
"strconv"
+ "code.google.com/p/goauth2/oauth"
+
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
- //"github.com/gogits/gogs/modules/oauth2"
-
- "code.google.com/p/goauth2/oauth"
- "github.com/martini-contrib/oauth2"
+ "github.com/gogits/gogs/modules/oauth2"
)
type SocialConnector interface {
@@ -80,6 +80,10 @@ func SocialSignIn(ctx *middleware.Context, tokens oauth2.Tokens) {
Extra: tokens.ExtraData(),
},
}
+ if len(tokens.Access()) == 0 {
+ log.Error("empty access")
+ return
+ }
var err error
var u *models.User
if err = gh.Update(); err != nil {