updated ethereum smart contract. Implemented backend of the login library example

This commit is contained in:
arnaucode
2018-01-18 16:03:18 +01:00
parent 9770437d3f
commit 55594e3b45
24 changed files with 632 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

View File

@@ -21,29 +21,30 @@
placeholder="Enter here the proof-of-decrypt..."
></textarea>
</div>
<h5 ng-show="decryptData.m">PoD:</h5>
{{decryptData.m}}
<div ng-click="decrypt()" ng-show="id.blockchainref" class="btn btn-raised pull-right c_o_pink300">
Proof of decrypt
</div>
</div>
</div>
<br><br><br><br><br>
<hr>
<div class="row">
<h5>Testing only:</h5>
<div class="row">
<textarea style="color:#000000;width:100%;" rows="4"
ng-model="encryptData.m"
placeholder="Enter here the unencrypted..."
></textarea>
</div>
<textarea style="backgroud:grey;color:#000000;width:100%;" rows="4"
ng-model="encryptData.c"
placeholder="Encrypted data..."
></textarea>
<div ng-click="encrypt()" ng-show="id.blockchainref" class="btn btn-raised pull-right c_o_orange300">
Encrypt
<br><br><br><br><br>
<hr>
<h5>Testing only:</h5>
<div class="row">
<textarea style="color:#000000;width:100%;" rows="4"
ng-model="encryptData.m"
placeholder="Enter here the unencrypted..."
></textarea>
</div>
<div class="row">
<textarea style="backgroud:grey;color:#000000;width:100%;" rows="4"
ng-model="encryptData.c"
placeholder="Encrypted data..."
></textarea>
</div>
<div ng-click="encrypt()" ng-show="id.blockchainref" class="btn btn-raised pull-right c_o_orange300">
Encrypt
</div>
</div>
</div>
</div>

View File

@@ -49,7 +49,7 @@ angular.module('app.login', ['ngRoute'])
window.location.reload();
} else {
console.log("login failed");
toastr.error('Login failed');
toastr.error('Login failed, ' + data.data);
}

View File

@@ -9,11 +9,27 @@ angular.module('app.signup', ['ngRoute'])
});
}])
.controller('SignupCtrl', function($scope, $http, $routeParams) {
.controller('SignupCtrl', function($scope, $http, $routeParams, $rootScope) {
$scope.user = {};
$scope.doSignup = function() {
$scope.signup = function() {
console.log('Doing signup', $scope.user);
$http({
url: $rootScope.server + 'signup',
method: "POST",
headers: {
"Content-Type": undefined
},
data: $scope.user
})
.then(function(data) {
console.log("data: ");
console.log(data.data);
window.location="/";
},
function(data) {
console.log(data);
});
};
});