Pin flow
This commit is contained in:
parent
d045fc719e
commit
0c0e11aad3
3 changed files with 182 additions and 19 deletions
38
js/services/pinService.js
Normal file
38
js/services/pinService.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services')
|
||||
.factory('pinService', function($rootScope) {
|
||||
var root = {};
|
||||
var storage = {
|
||||
pinData: {
|
||||
pin: 1234,
|
||||
credentials: {
|
||||
email: '4@queparece',
|
||||
password: '1',
|
||||
}
|
||||
}
|
||||
};
|
||||
root.check = function() {
|
||||
return storage.pinData ? true : false;
|
||||
};
|
||||
root.get = function(pin) {
|
||||
var storedPin = storage.pinData.pin;
|
||||
if (storedPin !== pin)
|
||||
return;
|
||||
|
||||
return storage.pinData.credentials;
|
||||
};
|
||||
root.save = function(pin, email, password) {
|
||||
storage.pinData = {
|
||||
pin: pin,
|
||||
credentials: {
|
||||
email: email,
|
||||
password: password
|
||||
}
|
||||
};
|
||||
};
|
||||
root.clear = function(){
|
||||
delete storage['pinData'];
|
||||
};
|
||||
return root;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue