1 Answer
1

You'll want to create a user plugin that responds to the onBeforeStoreUser event instead of an authentication plugin. The plugin creation process is much the same for user plugins. The onBeforeStoreUser event receives two arguments: the user object and a boolean flag indicating whether or not the user is a new one.

You can look at plugins/user/example.php to see all of the user plugin event handlers.