Store `user_mac_key
` in keychain and not in plaintext preference file
This commit is contained in:
parent
555e7cca3c
commit
c4fdb2b5cd
7 changed files with 66 additions and 9 deletions
|
@ -146,7 +146,7 @@ function(HostApp, Paths, Hmac) {
|
|||
var access = JSON.parse(responseBody);
|
||||
|
||||
HostApp.setStringForKey(access["access_token"], "user_access_token");
|
||||
HostApp.setStringForKey(access["mac_key"], "user_mac_key");
|
||||
HostApp.setSecret(access["mac_key"]);
|
||||
HostApp.setStringForKey(access["mac_algorithm"], "user_mac_algorithm");
|
||||
HostApp.setStringForKey(access["token_type"], "user_token_type");
|
||||
|
||||
|
|
|
@ -10,6 +10,23 @@ define(function() {
|
|||
controller.setStringForKey(string, key);
|
||||
}
|
||||
}
|
||||
|
||||
HostApp.setSecret = function(string) {
|
||||
|
||||
if (OS_TYPE == "mac") {
|
||||
controller.setSecret_(string);
|
||||
} else {
|
||||
controller.setStringForKey(string, "user_mac_key");
|
||||
}
|
||||
}
|
||||
|
||||
HostApp.secret = function() {
|
||||
if (OS_TYPE == "mac") {
|
||||
return controller.secret();
|
||||
} else {
|
||||
return controller.stringForKey("user_mac_key");
|
||||
}
|
||||
}
|
||||
|
||||
HostApp.stringForKey = function(key) {
|
||||
|
||||
|
|
Reference in a new issue