try { const response = await fetch('http://localhost:4040/api/account/signup', { method: 'POST', body: form_data, }); const json = await response.json(); if (json.accessToken) { Auth.setToken(json.accessToken); this.context.loginHandler(true); this.props.history.push('/'); return true; } else { for(var k in json.errors) { actions.setFieldError("login", json.errors[k]); } actions.setSubmitting(false); } } catch(e) { }