Sha256: fdcbb3c5930dff79533c736b594cc104b9b42661af2c4e3fdf19c02b6636df71

Contents?: true

Size: 858 Bytes

Versions: 19

Compression:

Stored size: 858 Bytes

Contents

import {Controller} from 'a1atscript';

@Controller('SessionsCtrl', ['$scope', '$auth', '$state', '$xngToast', 'Serializer', 'authConfig', 'Inflector'])
export default function SessionsController( $scope, $auth, $state, $xngToast, Serializer, authConfig, Inflector) {
  $scope.session = {
    password: ''
  };
  $scope.session[authConfig.authKey] = '';
  $scope.authKey = authConfig.authKey;
  $scope.humanAuthKey = Inflector.humanize(authConfig.authKey);
  $scope.passwordShow = authConfig.recoverable;

  $scope.sessionSubmit = function() {
    var serializer = new Serializer();

    $auth.submitLogin(serializer.serialize({user: $scope.session}))
      .then(function(resp) {
        $state.go('root.inner.sessionsSuccess');
      })
      .catch(function(resp) {
        $xngToast.error(resp.errors);
        // handle error response
      });
  };

}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
xing-framework-1.0.0.pre.beta.1 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-1.0.0.pre.beta default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-1.0.0.pre.alpha default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.3.2 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.3.1 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.3.0 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.9 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.9.beta1 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.8 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.8.beta1 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.7 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.7.pre.beta1 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.6 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.5 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.4 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.3 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.2 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.1 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js
xing-framework-0.2.0 default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js