Wrap set credentials for the keychain in a try/catch (#1962)
* Wrap set credentials for the keychain in a try/catch * Only wrap the setGenericPassword method
This commit is contained in:
parent
5bed4d7400
commit
102faceb2b
1 changed files with 6 additions and 1 deletions
|
|
@ -161,6 +161,7 @@ export default class App {
|
|||
if (!currentUserId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const username = `${deviceToken}, ${currentUserId}`;
|
||||
const password = `${token},${url}`;
|
||||
|
||||
|
|
@ -172,7 +173,11 @@ export default class App {
|
|||
|
||||
// Only save to keychain if the url and token are set
|
||||
if (url && token) {
|
||||
setGenericPassword(username, password);
|
||||
try {
|
||||
setGenericPassword(username, password);
|
||||
} catch (e) {
|
||||
console.warn('could not set credentials', e); //eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue