Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webhook for signup via social login doesn't fire, signup through login ui will fire webhook #2912

Closed
ivancetus opened this issue Apr 30, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@ivancetus
Copy link

in controllers auth.go

previously working version use two object.AddRecord to send webhooks

record := object.NewRecord(c.Ctx)
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) })

however, current version use this method which I have no idea how it works

c.Ctx.Input.SetParam("recordUserId", user.GetId())
c.Ctx.Input.SetParam("recordSignup", "true")

as title says, it won't send webhook for social login (signup)

@casbin-bot
Copy link
Contributor

@casbin-bot casbin-bot added the question Further information is requested label Apr 30, 2024
@ivancetus
Copy link
Author

update: I notice that in routers/record.go AfterRecordMessage webhook action is stated as record2.Action = "new-user" instead of signup, I got the functionality back by adding an identical webhook for my signup webhook that listens for action "new-user".

@hsluoyz
Copy link
Member

hsluoyz commented Apr 30, 2024

@ivancetus yes, it's renamed to "new-user" now

@hsluoyz hsluoyz closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants