Sha256: 8e41bc1b31a9cadf726c4340bc153c9214498919f4b36f6a37ecf74c8c6f26c1

Contents?: true

Size: 640 Bytes

Versions: 1

Compression:

Stored size: 640 Bytes

Contents

Sprangular.controller 'ForgotPasswordCtrl', (
  $scope,
  $location,
  Account,
  Flash,
  Status,
  $translate
) ->
  $translate('app.forgot_password').then (paragraph) ->
    Status.title = paragraph

  request = { email: '', errors: {} }

  $scope.request = request

  $scope.submit = ->
    request.errors = {}

    success = ->
      $location.path '/'
      Flash.error('app.confirm_reset_password')

    error = (response) ->
      $translate('app.email_not_found').then (paragraph) ->
        request.errors['email'] = paragraph

    Account.forgotPassword(request).then(success, error)

  $scope.cancel = ->
    $location.path '/'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sprangular-0.1.0 app/assets/javascripts/sprangular/controllers/forgotPassword.coffee