.get("https://api.chatengine.io/users/me/", {
headers,
})
.then((r) => {
if (r.status === 200) {
const user: PersonObject = {
first_name: r.data.first_name,
last_name: r.data.last_name,
email: email,
username: email,
secret: password,
avatar: r.data.avatar,
custom_json: {},
is_online: true,
};
setUser(user);
}
})
.catch((e) => console.log("Error", e));
};
return (
<div>
<div className="form-title">Welcome To The Chat-Application</div>
<div className="form-subtitle">
New here? <Link onClick={() => props.onHasNoAccount()}>Sign Up</Link>
</div>
<form onSubmit={onSubmit}>
<TextInput
label="Email"
name="email"
placeholder="
[email protected]"
onChange={(e) => setEmail(e.target.value)}
/>
<TextInput
label="Password"
name="password"
placeholder="********"
type="password"
onChange={(e) => setPassword(e.target.value)}
/>
<Button type="submit">Log In</Button>
</form>
</div>