]> source.dussan.org Git - gitea.git/commitdiff
safe check
authorUnknwon <joe2010xtmf@163.com>
Sat, 29 Nov 2014 02:54:49 +0000 (21:54 -0500)
committerUnknwon <joe2010xtmf@163.com>
Sat, 29 Nov 2014 02:54:49 +0000 (21:54 -0500)
routers/user/social.go

index a8a94a5c45ffbb57685ddfe864b3043085c60331..913fc094fe04ef6d54b3130ec471cbda80567dbe 100644 (file)
@@ -51,6 +51,10 @@ func SocialSignIn(ctx *middleware.Context) {
                ctx.Handle(500, fmt.Sprintf("UserInfo(%s)", name), err)
                return
        }
+       if len(ui.Identity) == 0 {
+               ctx.Handle(404, "no identity is presented", errors.New(name))
+               return
+       }
        log.Info("social.SocialSignIn(social login): %s", ui)
 
        oa, err := models.GetOauth2(ui.Identity)