MCPcopy Create free account
hub / github.com/CommE2E/comm / fetchNativeKeychainCredentials

Function fetchNativeKeychainCredentials

native/account/native-credentials.js:23–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21};
22
23async function fetchNativeKeychainCredentials(): Promise<?UserCredentials> {
24 if (storedNativeKeychainCredentials.state === 'determined') {
25 return storedNativeKeychainCredentials.credentials;
26 }
27 try {
28 const result = await getInternetCredentials('comm.app');
29 const credentials = result
30 ? { username: result.username, password: result.password }
31 : undefined;
32 storedNativeKeychainCredentials = { state: 'determined', credentials };
33 return credentials;
34 } catch (e) {
35 const credentials = null;
36 storedNativeKeychainCredentials = { state: 'unsupported', credentials };
37 return credentials;
38 }
39}
40
41async function fetchNativeCredentials(): Promise<?UserCredentials> {
42 const keychainCredentials = await fetchNativeKeychainCredentials();

Calls

no outgoing calls

Tested by

no test coverage detected