From 3d0cf8788b8575fdf295810b24f4b3db492921c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=BE=D0=B2=D0=B0=D1=80=D0=B8=D1=89=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B8=D1=81=D1=82?= <46831212+ComradeProgrammer@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:34:56 +0800 Subject: [PATCH] fix: trigger missing webhook (#770) * fix: trigger missing webhook * Update auth.go Co-authored-by: Gucheng <85475922+nomeguy@users.noreply.github.com> --- controllers/auth.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/controllers/auth.go b/controllers/auth.go index 4918f99b..1ca00eb9 100644 --- a/controllers/auth.go +++ b/controllers/auth.go @@ -409,6 +409,12 @@ func (c *ApiController) Login() { record.Organization = application.Organization record.User = user.Name util.SafeGoroutine(func() { object.AddRecord(record) }) + + record2 := object.NewRecord(c.Ctx) + record2.Action = "signup" + record2.Organization = application.Organization + record2.User = user.Name + util.SafeGoroutine(func() { object.AddRecord(record2) }) } else if provider.Category == "SAML" { resp = &Response{Status: "error", Msg: "The account does not exist"} } @@ -452,6 +458,11 @@ func (c *ApiController) Login() { user := c.getCurrentUser() resp = c.HandleLoggedIn(application, user, &form) + + record := object.NewRecord(c.Ctx) + record.Organization = application.Organization + record.User = user.Name + util.SafeGoroutine(func() { object.AddRecord(record) }) } else { c.ResponseError(fmt.Sprintf("unknown authentication type (not password or provider), form = %s", util.StructToJson(form))) return