1 2 3 4 5 6 7 8 9 10 11
export default (email, password) => ( fetch('/api/user/login', { method: 'POST', headers: { 'Content-Type': 'application/json;charset=utf-8' }, body: JSON.stringify({ email, password }), }) .then(() => window.location.href = "/admin") .catch(() => {}) );