<commit_before>import React from 'react'
import request from 'request'
import { SegmentAnalytics, Events } from '../../../../../modules/analytics'; 
import { Input } from 'quill-component-library/dist/componentLibrary'

import getAuthToken from '../../modules/get_auth_token';

export default class ForgotPassword extends React.Component {
  constructor() {
    super();

    this.state = {
      password: '',
      passwordConfirmation: '',
      errors: {},
      timesSubmitted: 0,
    };

    this.handlePasswordChange = this.handlePasswordChange.bind(this);
    this.handlePasswordConfirmationChange = this.handlePasswordConfirmationChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }

  handlePasswordChange(e) {
    this.setState({ password: e.target.value, });
  }

  handlePasswordConfirmationChange(e) {
    this.setState({ passwordConfirmation: e.target.value, });
  }

  submitClass() {
    let buttonClass = "quill-button contained primary medium"
    if (!this.state.password.length || !this.state.passwordConfirmation.length) {
      buttonClass += ' disabled'
    }
    return buttonClass
  }

  handleSubmit(e) {
    const { timesSubmitted, password, passwordConfirmation, } = this.state
    e.preventDefault();
    SegmentAnalytics.track(Events.SUBMIT_SAVE_NEW_PASSWORD);
    request({
      url: window.location.href,
      method: 'PUT',
      json: {
        user: {
          password,
          password_confirmation: <PASSWORD>,
        },
        authenticity_token: getAuthToken(),
      },
    },
    (err, httpResponse, body) => {
      if (httpResponse.statusCode === 200 && body.redirect) {
        // console.log(body);
        window.location = `${process.env.DEFAULT_URL}${body.redirect}`;
      } else {
        let state
        if (body.type && body.message) {<commit_msg>Add required param to tracking event<commit_after>import React from 'react'
import request from 'request'
import { SegmentAnalytics, Events } from '../../../../../modules/analytics'; 
import { Input } from 'quill-component-library/dist/componentLibrary'

import getAuthToken from '../../modules/get_auth_token';

export default class ForgotPassword extends React.Component {
  constructor() {
    super();

    this.state = {
      password: '',
      passwordConfirmation: '',
      errors: {},
      timesSubmitted: 0,
    };

    this.handlePasswordChange = this.handlePasswordChange.bind(this);
    this.handlePasswordConfirmationChange = this.handlePasswordConfirmationChange.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }

  handlePasswordChange(e) {
    this.setState({ password: e.target.value, });
  }

  handlePasswordConfirmationChange(e) {
    this.setState({ passwordConfirmation: e.target.value, });
  }

  submitClass() {
    let buttonClass = "quill-button contained primary medium"
    if (!this.state.password.length || !this.state.passwordConfirmation.length) {
      buttonClass += ' disabled'
    }
    return buttonClass
  }

  handleSubmit(e) {
    const { timesSubmitted, password, passwordConfirmation, } = this.state
    e.preventDefault();
    SegmentAnalytics.track(Events.SUBMIT_SAVE_NEW_PASSWORD, {source: 'passwordResetPage'});
    request({
      url: window.location.href,
      method: 'PUT',
      json: {
        user: {
          password,
          password_confirmation: <PASSWORD>,
        },
        authenticity_token: getAuthToken(),
      },
    },
    (err, httpResponse, body) => {
      if (httpResponse.statusCode === 200 && body.redirect) {
        // console.log(body);
        window.location = `${process.env.DEFAULT_URL}${body.redirect}`;
      } else {
        let state
        if (body.type && body.message) {
{'fraction_non_alphanumeric': 0.13272434175174638, 'fraction_numerical': 0.0021493820526598604, 'mean_word_length': 3.037960954446855, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5716016', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1056, 'n_words': 205}