Skip to content

Commit

Permalink
fix: Missing extendedUser in signup webhook (casdoor#522)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve0x2a <[email protected]>
  • Loading branch information
Steve0x2a authored Mar 1, 2022
1 parent a5d166c commit d48d515
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion controllers/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (c *ApiController) Signup() {
username = id
}

userCount := object.GetUserCount(form.Organization, "", "") + 1
userCount := object.GetUserCount(form.Organization, "", "") + 1

user := &object.User{
Owner: form.Organization,
Expand Down Expand Up @@ -199,6 +199,11 @@ func (c *ApiController) Signup() {
object.DisableVerificationCode(form.Email)
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)

c.ResponseOk(userId)
Expand Down
2 changes: 1 addition & 1 deletion routers/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func getUserByClientIdSecret(ctx *context.Context) string {
}

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
}

Expand Down

0 comments on commit d48d515

Please sign in to comment.