Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
<button type="button"> netlifyIdentity.open("signup")}>
Signup</button>
login () {
netlifyIdentity.open('login')
}
}
handleLogin = type => () => {
netlifyIdentity.open(type);
};
render() {
return new Promise((resolve, reject) => {
if (isLoggedIn()) {
resolve();
} else {
netlifyIdentity.open();
netlifyIdentity.on('login', user => {
netlifyIdentity.close();
resolve();
});
}
netlifyIdentity.on('error', err => {
reject(err);
});
});
}
onClick={() => netlifyIdentity.open("login")}
>
authenticate = ({ showSignup = false, onSuccess }) => {
netlifyIdentity.open(showSignup && 'signup');
netlifyIdentity.on('login', user => {
this.setState({ user });
onSuccess && onSuccess(user);
});
};