Auth0 Home Blog Docs

Is it correct that rules only fire on login, and not a signup?

signup
rules
login
not-working

#1

I cant seem to set any app or user metadata when signing up a user, and looking at the logs the rules is not firing at all. Only when I call the webauth.client.login will the rules fire, and not on webauth.signup.


Extra validation username field in sign up form Login by Auth0 wordpress plugin
#2

Yes, that is expected. Rules execute after the initial authentication step is completed; for a database connection user that would mean that the user provided correct credentials (username/email and password); they do not execute at user signup.

If your use case is around database connections you should check the pre-registration hook; if it’s independent of connection you may want to consider a rule that only performs that logic once based on a certain flag that indicates that you’re treating this execution of rules as the first with regards to metadata initialization.


#3

Cheers! That clarifies a lot, and thanks for redirecting me :slight_smile:


#4

Cheers! That clarifies a lot, and thanks for redirecting me :slight_smile:


#5