Another option is to pass the token generation function to the options object. You can see how it's used if you scroll down a bit.
Check my answer to a somewhat related question for steps on how to override the User model and pass the options object to the verify() method.
You can do this in the remote hook after you create a new User, e.g.:
User.afterRemote('create', function(context, user, next) {
var userModel = User.constructor;
myTokenGenerator = function(user, cb) {
myToken = '1234'
cb(null, myToken);
};
var options = {
type: 'email',
mailer: Email,
to: user.email,
from: senderEmail,
subject: 'My subject',
template: path.resolve(__dirname, '../views/verify.ejs'),
user: user,
host: myEmailHost,
port: myEmailPort,
generateVerificationToken: myTokenGenerator
};
user.verify(options, function(err, response) {
if (err) {
next(err);
return;
}
console.log("Account verification email sent to " + options.to);
next();
return;
});
});