Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
checkContact(user) {
if (!Auth || typeof Auth.verifiedContact !== 'function') {
throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported');
}
Auth.verifiedContact(user).then(data => {
if (!isEmpty(data.verified)) {
this.handleAuthStateChange(AuthState.SignedIn, user);
} else {
user = Object.assign(user, data);
this.handleAuthStateChange(AuthState.VerifyContact, user);
}
});
}
async checkContact(user) {
if (!Auth || typeof Auth.verifiedContact !== 'function') {
throw new Error(NO_AUTH_MODULE_FOUND);
}
try {
const data = await Auth.verifiedContact(user);
if (!isEmpty(data.verified)) {
this.handleAuthStateChange(AuthState.SignedIn, user);
} else {
user = Object.assign(user, data);
this.handleAuthStateChange(AuthState.VerifyContact, user);
}
} catch (error) {
logger.error(error);
throw new Error(error);
}
}
checkContact(user) {
if (!Auth || typeof Auth.verifiedContact !== 'function') {
throw new Error('No Auth module found, please ensure @aws-amplify/auth is imported');
}
Auth.verifiedContact(user).then(data => {
if (!isEmpty(data.verified)) {
this.handleAuthStateChange(AuthState.SignedIn, user);
} else {
user = Object.assign(user, data);
this.handleAuthStateChange(AuthState.VerifyContact, user);
}
});
}