mirror of https://github.com/BTCPrivate/copay.git
create working. add attempt notification
This commit is contained in:
parent
d3726d658c
commit
aa64054657
|
@ -4,9 +4,9 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
||||||
|
|
||||||
|
|
||||||
var _credentials, _firstpin;
|
var _credentials, _firstpin;
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
$scope.isMobile = isMobile.any();
|
$scope.isMobile = isMobile.any();
|
||||||
|
$scope.attempt=0;
|
||||||
|
|
||||||
// This is only for backwards compat, insight api should link to #!/confirmed directly
|
// This is only for backwards compat, insight api should link to #!/confirmed directly
|
||||||
if (getParam('confirmed')) {
|
if (getParam('confirmed')) {
|
||||||
|
@ -28,6 +28,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
||||||
pinService.check(function(err, value) {
|
pinService.check(function(err, value) {
|
||||||
$rootScope.hasPin = value;
|
$rootScope.hasPin = value;
|
||||||
});
|
});
|
||||||
|
$scope.usingLocalStorage = config.plugins.EncryptedLocalStorage;
|
||||||
};
|
};
|
||||||
|
|
||||||
pinService.makePinInput($scope, 'pin', function(newValue) {
|
pinService.makePinInput($scope, 'pin', function(newValue) {
|
||||||
|
@ -139,6 +140,12 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
||||||
copay.logger.warn(err);
|
copay.logger.warn(err);
|
||||||
if ((err.toString() || '').match('PNOTFOUND')) {
|
if ((err.toString() || '').match('PNOTFOUND')) {
|
||||||
$scope.error = 'Invalid email or password';
|
$scope.error = 'Invalid email or password';
|
||||||
|
|
||||||
|
if($scope.attempt++>1) {
|
||||||
|
var storage = $scope.usingLocalStorage ? 'this device storage' : 'cloud storage';
|
||||||
|
$scope.error = 'Invalid email or password. You are trying to sign in using ' + storage + '. Change it on settings is necessary.';
|
||||||
|
};
|
||||||
|
|
||||||
pinService.clear(function() {
|
pinService.clear(function() {
|
||||||
});
|
});
|
||||||
} else if ((err.toString() || '').match('Connection')) {
|
} else if ((err.toString() || '').match('Connection')) {
|
||||||
|
|
|
@ -3,10 +3,18 @@
|
||||||
<div class="loading-screen" ng-show="$root.starting">
|
<div class="loading-screen" ng-show="$root.starting">
|
||||||
<div class="spinner">
|
<div class="spinner">
|
||||||
<div class="contener_general">
|
<div class="contener_general">
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_1"> </div></div>
|
<div class="contener_mixte">
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_2"> </div></div>
|
<div class="ballcolor ball_1"> </div>
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_3"> </div></div>
|
</div>
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_4"> </div></div>
|
<div class="contener_mixte">
|
||||||
|
<div class="ballcolor ball_2"> </div>
|
||||||
|
</div>
|
||||||
|
<div class="contener_mixte">
|
||||||
|
<div class="ballcolor ball_3"> </div>
|
||||||
|
</div>
|
||||||
|
<div class="contener_mixte">
|
||||||
|
<div class="ballcolor ball_4"> </div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="text-gray size-12" translate>Accessing your profile...</span>
|
<span class="text-gray size-12" translate>Accessing your profile...</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -34,7 +42,6 @@
|
||||||
<h3>
|
<h3>
|
||||||
Your email was confimed!
|
Your email was confimed!
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
Please sign in to access your wallets
|
Please sign in to access your wallets
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -49,7 +56,7 @@
|
||||||
|
|
||||||
<div class="box-setup" ng-if="askForPin">
|
<div class="box-setup" ng-if="askForPin">
|
||||||
<h1><span translate>Set up a </span> <b> PIN </b>?</h1>
|
<h1><span translate>Set up a </span> <b> PIN </b>?</h1>
|
||||||
<p class="size-14"> Enter a 4-digit number for easier access from this device</p>
|
<p class="size-14">Enter a 4-digit number for easier access from this device</p>
|
||||||
|
|
||||||
<div class="box-notification" ng-show="error">
|
<div class="box-notification" ng-show="error">
|
||||||
<div class="box-icon error">
|
<div class="box-icon error">
|
||||||
|
@ -62,17 +69,11 @@
|
||||||
|
|
||||||
<form name="setPinForm" ng-model="setPinForm" ng-submit="createPin(setPinForm)" novalidate>
|
<form name="setPinForm" ng-model="setPinForm" ng-submit="createPin(setPinForm)" novalidate>
|
||||||
<div class="input" ng-show="askForPin == 1">
|
<div class="input" ng-show="askForPin == 1">
|
||||||
<input id="newpin" type="tel" ng-model="newpin" class="form-control"
|
<input id="newpin" type="tel" ng-model="newpin" class="form-control" ng-maxlength="4" ng-minlength="4" maxlength="4" ng-pattern="/^[0-9]{1,4}$/" placeholder="PIN" name="newpin" required show-focus="askForPin == 1">
|
||||||
ng-maxlength="4" ng-minlength="4" maxlength="4"
|
|
||||||
ng-pattern="/^[0-9]{1,4}$/"
|
|
||||||
placeholder="PIN" name="newpin" required show-focus="askForPin == 1">
|
|
||||||
<i class="icon-locked"></i>
|
<i class="icon-locked"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="input" ng-show="askForPin == 2">
|
<div class="input" ng-show="askForPin == 2">
|
||||||
<input id="repeatpin" type="tel" ng-model="repeatpin" class="form-control"
|
<input id="repeatpin" type="tel" ng-model="repeatpin" class="form-control" ng-maxlength="4" ng-minlength="4" maxlength="4" ng-pattern="/^[0-9]{1,4}$/" placeholder="Confirm your PIN" name="repeatpin" required show-focus="askForPin == 2">
|
||||||
ng-maxlength="4" ng-minlength="4" maxlength="4"
|
|
||||||
ng-pattern="/^[0-9]{1,4}$/"
|
|
||||||
placeholder="Confirm your PIN" name="repeatpin" required show-focus="askForPin == 2">
|
|
||||||
<i class="icon-locked"></i>
|
<i class="icon-locked"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -83,8 +84,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-6 medium-6 small-6 columns text-right">
|
<div class="large-6 medium-6 small-6 columns text-right">
|
||||||
<button translate type="submit" class="button primary radius expand m0"
|
<button translate type="submit" class="button primary radius expand m0" ng-disabled="setPinForm.$invalid || error">
|
||||||
ng-disabled="setPinForm.$invalid || error">
|
|
||||||
OK
|
OK
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -107,10 +107,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input id="pin" type="tel" ng-model="pin" class="form-control"
|
<input id="pin" type="tel" ng-model="pin" class="form-control" ng-maxlength="4" ng-minlength="4" maxlength="4" ng-pattern="/^[0-9]{1,4}$/" placeholder="Pin number" name="pin" required>
|
||||||
ng-maxlength="4" ng-minlength="4" maxlength="4"
|
|
||||||
ng-pattern="/^[0-9]{1,4}$/"
|
|
||||||
placeholder="Pin number" name="pin" required>
|
|
||||||
<i class="icon-locked"></i>
|
<i class="icon-locked"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -122,8 +119,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-6 medium-6 small-6 columns text-right">
|
<div class="large-6 medium-6 small-6 columns text-right">
|
||||||
<button translate type="submit" class="button primary radius expand m0"
|
<button translate type="submit" class="button primary radius expand m0" ng-disabled="pinForm.$invalid || error">
|
||||||
ng-disabled="pinForm.$invalid || error">
|
|
||||||
Sign in
|
Sign in
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -131,32 +127,32 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="box-setup" ng-if='!$root.hasPin && !askForPin'>
|
<div class="box-setup" ng-if='!$root.hasPin && !askForPin'>
|
||||||
<h1><span translate>Sign in to</span> <b>Copay</b></h1>
|
<h1><span translate>Sign in to</span> <b>Copay</b></h1>
|
||||||
<form name="loginForm" ng-submit="openWithCredentials(loginForm)" novalidate>
|
<form name="loginForm" ng-submit="openWithCredentials(loginForm)" novalidate>
|
||||||
<p class="text-warning size-12"
|
<p class="text-warning size-12" ng-show="error">
|
||||||
ng-show="error">
|
<i class="fi-x"></i> {{error|translate}}
|
||||||
<i class="fi-x"></i>
|
</p>
|
||||||
{{error|translate}}
|
|
||||||
</p>
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input type="email" ng-model="email" class="form-control"
|
<input type="email" ng-model="email" class="form-control" name="email" placeholder="Email" required show-focus="!isMobile">
|
||||||
name="email" placeholder="Email" required show-focus="!isMobile">
|
|
||||||
<i class="icon-email"></i>
|
<i class="icon-email"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input type="password" ng-model="password" class="form-control"
|
<input type="password" ng-model="password" class="form-control" name="password" placeholder="Password" required>
|
||||||
name="password" placeholder="Password" required>
|
|
||||||
<i class="icon-locked"></i>
|
<i class="icon-locked"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button translate type="submit" class="button primary radius expand m0"
|
<button translate type="submit" class="button primary radius expand m0" ng-disabled="loginForm.$invalid || loading">
|
||||||
ng-disabled="loginForm.$invalid || loading">
|
|
||||||
Sign in
|
Sign in
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<div ng-if="usingLocalStorage" class="text-gray size-12">
|
||||||
|
* Using this device storage. Change to cloud storage on 'settings'.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="box-setup-footer">
|
<div class="box-setup-footer">
|
||||||
<div class="left m10r">
|
<div class="left m10r">
|
||||||
<a class="button-setup text-gray" href="#!/createProfile">
|
<a class="button-setup text-gray" href="#!/createProfile">
|
||||||
|
|
Loading…
Reference in New Issue