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

No webhook event on email creation and on username change. #2009

Open
2 tasks done
emanuele-scarsella opened this issue Dec 17, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@emanuele-scarsella
Copy link

Checklist

  • I could not find a solution in the existing issues or docs.
  • I agree to follow this project's Code of Conduct.

Describe the bug

Contrary to what the documentation say it seams that there is no event send to the webhook when a user creates a new email nor when the user updates his account in any other way (as for example by changing his username) on self-hosted hanko server running on docker.
The documentation list the following event types:

Event Triggers on
user user creation, user deletion, user update, email creation, email deletion, change of primary email
user.create user creation
user.delete user deletion
user.update user update, email creation, email deletion, change of primary email
user.update.email email creation, email deletion, change of primary email
user.update.email.create email creation
user.update.email.delete email deletion
user.update.email.primary change of primary email
email.send an email was send

but independently from how the configuration file is set, the only received events are the following:

Event
user.create
user.delete
user.update.email.delete
user.update.email.primary
email.send

Beside the missing parent events that don't need to be explicitly received if all the subevents are received, this leaves out the fundamental user.update that should be triggered by changes to the user that don't involve user emails (like username changes), and user.update.email.create that's the only way of knowing when a new secondary email is added by the user.

Reproducing the bug

To easily let anybody reproduce the bug I've made a minimal reproduction repository to leave no ambiguity.
The READEME.md file describes how to reproduce the problem but the steps are also listed below:

  1. Setup the repository:
git clone https://github.com/emanuelescarsella/hanko_missing_events_bug_reproduction.git
cd hanko_missing_events_bug_reproduction
npm install
  1. Run the containers and the express server:
docker-compose up -d
npm run start
  1. Open the browser and go to http://localhost:9000 to test several user interactions and visit http://localhost:5000 to validate user emails.

  2. Check the logs of the express server to see what events where received.

Logs

No response

Configuration

webhooks:
  enabled: true
  allow_time_expiration: false
  hooks:
    - callback: "http://host.docker.internal:9000/webhook"
      events:
        - user
        - user.create
        - user.delete
        - user.update
        - user.update.email
        - user.update.email.create
        - user.update.email.delete
        - user.update.email.primary
        - email.send

Hanko Version

v1.3.1

OS Hanko Backend

None

OS Version Hanko Backend

No response

OS

None

OS Version

No response

Browser Version

No response

Environment

Docker Compose

Additional Context

No response

@emanuele-scarsella emanuele-scarsella added the bug Something isn't working label Dec 17, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Hanko Dec 17, 2024
@FurquanAnwer
Copy link

Please assign me this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants