fix: Missing extendedUser in signup webhook (#522)

Signed-off-by: Steve0x2a <stevesough@gmail.com>
This commit is contained in:
Steve0x2a
2022-03-01 18:25:48 +08:00
committed by GitHub
parent a5d166c35f
commit d48d515c36
2 changed files with 7 additions and 2 deletions

View File

@ -147,7 +147,7 @@ func (c *ApiController) Signup() {
username = id username = id
} }
userCount := object.GetUserCount(form.Organization, "", "") + 1 userCount := object.GetUserCount(form.Organization, "", "") + 1
user := &object.User{ user := &object.User{
Owner: form.Organization, Owner: form.Organization,
@ -199,6 +199,11 @@ func (c *ApiController) Signup() {
object.DisableVerificationCode(form.Email) object.DisableVerificationCode(form.Email)
object.DisableVerificationCode(checkPhone) object.DisableVerificationCode(checkPhone)
record := object.NewRecord(c.Ctx)
record.Organization = application.Organization
record.User = user.Name
go object.AddRecord(record)
util.LogInfo(c.Ctx, "API: [%s] is signed up as new user", userId) util.LogInfo(c.Ctx, "API: [%s] is signed up as new user", userId)
c.ResponseOk(userId) c.ResponseOk(userId)

View File

@ -54,7 +54,7 @@ func getUserByClientIdSecret(ctx *context.Context) string {
} }
func RecordMessage(ctx *context.Context) { func RecordMessage(ctx *context.Context) {
if ctx.Request.URL.Path == "/api/login" { if ctx.Request.URL.Path == "/api/login" || ctx.Request.URL.Path == "/api/signup" {
return return
} }