Skip to content

Commit b867872

Browse files
authored
fix: return right after error response on GetUserInfo (beego#707)
1 parent 305867f commit b867872

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/account.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func (c *ApiController) Signup() {
210210
record := object.NewRecord(c.Ctx)
211211
record.Organization = application.Organization
212212
record.User = user.Name
213-
util.SafeGoroutine(func() {object.AddRecord(record)})
213+
util.SafeGoroutine(func() { object.AddRecord(record) })
214214

215215
userId := fmt.Sprintf("%s/%s", user.Owner, user.Name)
216216
util.LogInfo(c.Ctx, "API: [%s] is signed up as new user", userId)
@@ -285,6 +285,7 @@ func (c *ApiController) GetUserinfo() {
285285
resp, err := object.GetUserInfo(userId, scope, aud, host)
286286
if err != nil {
287287
c.ResponseError(err.Error())
288+
return
288289
}
289290
c.Data["json"] = resp
290291
c.ServeJSON()

0 commit comments

Comments
 (0)