<commit_before>'use strict';

var path = require('path');

module.exports = function(Usuario) {
  //send verification email after registration
  Usuario.afterRemote('create', function(context, user, next) {
    var options = {
      type: 'email',
      to: user.email,
      from: process.env.EMAIL_USER,
      subject: 'Thanks for registering.',
      template: path.resolve(__dirname, '../../server/views/verify.ejs'),
      redirect: '/verified',
      user: user
    };

    user.verify(options, function(err, response) {
      if (err) {
        User.destroyById(user.id);
        return next(err);
      }
      context.res.render('response', {
        title: 'Signed up successfully',
        content: 'Please check your email and click on the verification link ' +
            'before logging in.',
        redirectTo: '/',
        redirectToLinkText: 'Log in'
      });
    });
  });
  
};<commit_msg>Resolviendo el issue #26<commit_after>'use strict';

var path = require('path');

module.exports = function(Usuario) {
  //send verification email after registration
  Usuario.afterRemote('create', function(context, user, next) {
    var options = {
      type: 'email',
      to: user.email,
      from: process.env.EMAIL_USER,
      subject: 'Thanks for registering.',
      template: path.resolve(__dirname, '../../server/views/verify.ejs'),
      redirect: '/verified',
      user: user
    };

    user.verify(options, function(err, response) {
      if (err) {
        Usuario.destroyById(user.id);
        return next(err);
      }
      context.res.render('response', {
        title: 'Signed up successfully',
        content: 'Please check your email and click on the verification link ' +
            'before logging in.',
        redirectTo: '/',
        redirectToLinkText: 'Log in'
      });
    });
  });
  
};
{'fraction_non_alphanumeric': 0.14106753812636166, 'fraction_numerical': 0.0010893246187363835, 'mean_word_length': 2.4660377358490564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5154052', 'n_tokens_mistral': 533, 'n_tokens_neox': 529, 'n_words': 135}