|
|
|
@ -1,8 +1,10 @@
@@ -1,8 +1,10 @@
|
|
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
var LoginExistingCtrl = function($scope, $location, $routeParams, $q, email, auth, keychain) { |
|
|
|
|
var LoginExistingCtrl = function($scope, $location, $routeParams, $q, email, auth, keychain, account, dialog, appConfig) { |
|
|
|
|
!$routeParams.dev && !auth.isInitialized() && $location.path('/'); // init app
|
|
|
|
|
|
|
|
|
|
var str = appConfig.string; |
|
|
|
|
|
|
|
|
|
$scope.confirmPassphrase = function() { |
|
|
|
|
if ($scope.form.$invalid) { |
|
|
|
|
$scope.errMsg = 'Please fill out all required fields!'; |
|
|
|
@ -38,6 +40,18 @@ var LoginExistingCtrl = function($scope, $location, $routeParams, $q, email, aut
@@ -38,6 +40,18 @@ var LoginExistingCtrl = function($scope, $location, $routeParams, $q, email, aut
|
|
|
|
|
}).catch(displayError); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$scope.logout = function() { |
|
|
|
|
return dialog.confirm({ |
|
|
|
|
title: str.removePreAuthAccountTitle, |
|
|
|
|
message: str.removePreAuthAccountMessage, |
|
|
|
|
callback: function(confirm) { |
|
|
|
|
if (confirm) { |
|
|
|
|
account.logout().catch(dialog.error); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function displayError(err) { |
|
|
|
|
$scope.busy = false; |
|
|
|
|
$scope.incorrect = true; |
|
|
|
|