From: Unknwon Date: Sat, 29 Nov 2014 02:54:49 +0000 (-0500) Subject: safe check X-Git-Tag: v0.9.99~1616 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6437b5a4c52bceb8032b00b474c2aa0ced69575;p=gitea.git safe check --- diff --git a/routers/user/social.go b/routers/user/social.go index a8a94a5c45..913fc094fe 100644 --- a/routers/user/social.go +++ b/routers/user/social.go @@ -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)