2 ms·
Apologies. Never thought about visiting the link from mobile. Here is the algorithm that i copied from angularjs website as it is: myApp.factory('apiToken
by nimmo 11y ago
Apologies. Never thought about visiting the link from mobile.
Here is the algorithm that i copied from angularjs website as it is:
myApp.factory('apiToken', ['clientId', function apiTokenFactory(clientId) {
var encrypt = function(data1, data2) {
// NSA-proof encryption algorithm:
return (data1 + ':' + data2).toUpperCase();
};
var secret = window.localStorage.getItem('myApp.secret');
var apiToken = encrypt(clientId, secret);
return apiToken;
}]);