Auth0 Home Blog Docs

Slack notification rule is triggering more than once


I have a rule to inform me whenever a new user signs up to our system, however it seems that this rule is triggered more than once, sometimes even 10 or more times.
In the attached image you can see that the rule was triggered 4 times in a row, and after about ~40 minutes it was triggered twice.

Here is the rule itself:

function slackNotificationOnUserSignup(user, context, callback) {
  // short-circuit if the user signed up already or is using a refresh token
  if (context.stats.loginsCount > 1 || context.protocol === 'oauth2-refresh-token') {
    return callback(null, user, context);

  // get your slack's hook url from:
  const SLACK_HOOK = configuration.SLACK_HOOK_URL;

  const slack = require('slack-notify')(SLACK_HOOK);
  const message = 'New User: ' + ( || + ' (' + + ')';
  const channel = '#user_signup';

    text: message,
    channel: channel

  // don’t wait for the Slack API call to finish, return right away (the request will continue on the sandbox)`
  callback(null, user, context);