Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Restrict keychain access level
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Oct 23, 2019
1 parent 3da0675 commit 69cfb5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"react-native-file-viewer": "^1.0.10",
"react-native-fs": "^2.13.3",
"react-native-gesture-handler": "^1.0.12",
"react-native-keychain": "^1.2.1",
"react-native-keychain": "^3.1.3",
"react-native-store-review": "^0.1.3",
"react-native-vector-icons": "6.6.0",
"react-native-webview": "5.8.1",
Expand Down
6 changes: 5 additions & 1 deletion src/lib/keychain.js
Expand Up @@ -3,7 +3,11 @@ import * as RCTKeychain from 'react-native-keychain';
export default class Keychain {

static async setKeys(keys) {
return RCTKeychain.setGenericPassword("sn", JSON.stringify(keys))
const options = {
/* iOS only */
accessible: RCTKeychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY
};
return RCTKeychain.setGenericPassword("sn", JSON.stringify(keys), options)
.then(function() {
console.log('Credentials saved successfully!');
});
Expand Down

0 comments on commit 69cfb5c

Please sign in to comment.