Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getSupportedBiometryType().then(result => {
(result: ?string);
});
// $FlowExpectedError - First 3 arguments are required
setInternetCredentials();
setInternetCredentials('server', 'username', 'password');
setInternetCredentials('server', 'username', 'password', simpleOptions).then(
result => {
(result: void);
}
);
// $FlowExpectedError - First argument is required
hasInternetCredentials();
hasInternetCredentials('server').then(result => {
(result: boolean);
});
// $FlowExpectedError - First argument is required
getInternetCredentials();
getInternetCredentials('server', simpleOptions).then(credentials => {
if (credentials) {
(credentials.username: string);
(credentials.password: string);
}
});
// $FlowExpectedError - First argument is required
resetInternetCredentials();
resetInternetCredentials('server', simpleOptions).then(result => {
(result: void);
export async function isAuthorized () {
// TODO cache this with a TTL, since it's called on every state change
return Keychain.hasInternetCredentials(Config.API_URL)
}
export async function getAdditionalHeaders (url) {
const headers = {}
if (
Config.PREAUTH_URL != null &&
url.startsWith(Config.API_URL) &&
(await Keychain.hasInternetCredentials(Config.PREAUTH_URL))
) {
const { username, password } = await Keychain.getInternetCredentials(
Config.PREAUTH_URL
)
headers.Cookie = `${username}=${password}`
}
return headers
}