<commit_before>angular.module('Darkswarm').controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
  $scope.path = "/login"

  $scope.modalMessage = null

  $scope.$watch (->
    AuthenticationService.modalMessage
  ), (newValue) ->
    $scope.errors = newValue

  $scope.submit = ->
    Loading.message = t 'logging_in'
    $http.post("/user/spree_user/sign_in", {spree_user: $scope.spree_user}).then (response)->
      if Redirections.after_login
        $window.location.href = $window.location.origin + Redirections.after_login
      else
        $window.location.href = $window.location.origin + $window.location.pathname  # Strips out hash fragments
    .catch (response) ->
      Loading.clear()
      $scope.errors = response.data.message || response.data.error
      $scope.user_unconfirmed = (response.data.error == t('devise.failure.unconfirmed'))

  $scope.resend_confirmation = -><commit_msg>Track event on Login Submit Success<commit_after>angular.module('Darkswarm').controller "LoginCtrl", ($scope, $timeout, $location, $http, $window, AuthenticationService, Redirections, Loading) ->
  $scope.path = "/login"

  $scope.modalMessage = null

  $scope.$watch (->
    AuthenticationService.modalMessage
  ), (newValue) ->
    $scope.errors = newValue

  $scope.submit = ->
    Loading.message = t 'logging_in'
    $http.post("/user/spree_user/sign_in", {spree_user: $scope.spree_user}).then (response)->
      if window._paq
        window._paq.push(['trackEvent', 'Signin/Signup', 'Login Submit Success', $location.absUrl()]);
      if Redirections.after_login
        $window.location.href = $window.location.origin + Redirections.after_login
      else
        $window.location.href = $window.location.origin + $window.location.pathname  # Strips out hash fragments
    .catch (response) ->
      Loading.clear()
      $scope.errors = response.data.message || response.data.error
      $scope.user_unconfirmed = (response.data.error == t('devise.failure.unconfirmed'))

  $scope.resend_confirmation = ->
{'fraction_non_alphanumeric': 0.14601344860710855, 'fraction_numerical': 0.0, 'mean_word_length': 3.7665903890160184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '3024926', 'n_tokens_mistral': 650, 'n_tokens_neox': 621, 'n_words': 113}