<commit_before>import Ember from 'ember';

export default Ember.Controller.extend({
  session: Ember.inject.service('session'),

  actions: {
    create: function() {
      var nameRegex = /^[a-z0-9_-]{3,16}$/;
      var passwordRegex = /^[A-Za-z0-9_-]{8,18}$/;
      var name = this.get('name').toLowerCase();
      var password = this.get('password');
      var password_confirmation = this.get('password_confirmation');
      var dob = this.get('date');
      var today = Date.now();
      var twentyOne = today - Date.parse("January 1, 1991, 00:00:00 UTC");
      dob = Date.parse(dob);
      if (nameRegex.test(name) === false) {
        this.notifications.addNotification({
          message: 'username can only contain letters, numbers, underscores, or hyphens',
          type: 'error',
          autoClear: true,
          clearDuration: 4000
        });
      }
      else if (passwordRegex.test(password) === false) {
        this.notifications.addNotification({
          message: 'password can only contain letters, numbers, underscores, or hyphens',
          type: 'error',
          autoClear: true,
          clearDuration: 4000
        });
      }
      else if (password !== password_confirmation) {
        this.notifications.addNotification({
          message: 'password confirmation does not match password',
          type: 'error',
          autoClear: true,
          clearDuration: 3000
        });
      }
      else if (dob > twentyOne) {
        this.notifications.addNotification({
          message: 'you must twenty-one or older or lying to use this service',
          type: 'error',
          autoClear: true,
          clearDuration: 3000
        });
      }
      else {
        var user = this.store.createRecord('user', {
          name: name,
          password: password,<commit_msg>adds longer clear duration for dob errror<commit_after>import Ember from 'ember';

export default Ember.Controller.extend({
  session: Ember.inject.service('session'),

  actions: {
    create: function() {
      var nameRegex = /^[a-z0-9_-]{3,16}$/;
      var passwordRegex = /^[A-Za-z0-9_-]{8,18}$/;
      var name = this.get('name').toLowerCase();
      var password = this.get('password');
      var password_confirmation = this.get('password_confirmation');
      var dob = this.get('date');
      var today = Date.now();
      var twentyOne = today - Date.parse("January 1, 1991, 00:00:00 UTC");
      dob = Date.parse(dob);
      if (nameRegex.test(name) === false) {
        this.notifications.addNotification({
          message: 'username can only contain letters, numbers, underscores, or hyphens',
          type: 'error',
          autoClear: true,
          clearDuration: 4000
        });
      }
      else if (passwordRegex.test(password) === false) {
        this.notifications.addNotification({
          message: 'password can only contain letters, numbers, underscores, or hyphens',
          type: 'error',
          autoClear: true,
          clearDuration: 4000
        });
      }
      else if (password !== <PASSWORD>) {
        this.notifications.addNotification({
          message: 'password confirmation does not match password',
          type: 'error',
          autoClear: true,
          clearDuration: 3000
        });
      }
      else if (dob > twentyOne) {
        this.notifications.addNotification({
          message: 'you must twenty-one or older or lying to use this service',
          type: 'error',
          autoClear: true,
          clearDuration: 4000
        });
      }
      else {
        var user = this.store.createRecord('user', {
          name: name,
          password: password,
{'fraction_non_alphanumeric': 0.12605729877216917, 'fraction_numerical': 0.020190995907230558, 'mean_word_length': 2.1961639058413254, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '5754800', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1006, 'n_words': 271}