(function () { 'use strict'; var app = angular.module('user'); // A controller for user email verification app.controller('userVerifyEmailController', ['$scope', 'user', 'auth', '$rootScope', 'userSettingsDataContext', function ($scope, user, auth, $rootScope, userSettingsDataContext) { $rootScope.lockRouter = true; $scope.user = user; $scope.sent = false; $rootScope.resendEmailVerification = function (email) { userSettingsDataContext.resendEmailVerification(email).then(function () { $scope.sent = true; }); } $rootScope.signOut = function () { auth.logOut(); window.location = '#!/signin'; window.location.reload(); } } ]); // A controller for users to reset their passwords app.controller('userResetPasswordController', ['$scope', '$rootScope', 'config', 'userSettingsDataContext', function ($scope, $rootScope, config, userSettingsDataContext) { $rootScope.lockRouter = true; $scope.passwordModel = {}; $scope.passwordModel.applicationId = config.applicationId; $scope.resetPassword = function () { userSettingsDataContext.changePassword($scope.passwordModel).then(function () { $scope.done = true; window.location.reload(); }); } } ]); })();