diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-28 21:54:49 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-28 21:54:49 -0500 |
commit | b6437b5a4c52bceb8032b00b474c2aa0ced69575 (patch) | |
tree | a74b666342cfa16b9d529c20b785d283387bec0e /routers/user | |
parent | db4951bc61bb0b17edb759d01b1750a60e572fcc (diff) | |
download | gitea-b6437b5a4c52bceb8032b00b474c2aa0ced69575.tar.gz gitea-b6437b5a4c52bceb8032b00b474c2aa0ced69575.zip |
safe check
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/social.go | 4 |
1 files changed, 4 insertions, 0 deletions
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) |