瀏覽代碼

safe check

Unknwon 10 年之前
父節點
當前提交
b6437b5a4c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      routers/user/social.go

+ 4 - 0
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)