Minor hacks
This commit is contained in:
parent
c9ee91c5a8
commit
ac26f6f46d
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "react-login-page",
|
"name": "react-login-page",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
|
"homepage": "/newuser/",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "^16.8.6",
|
"react": "^16.8.6",
|
||||||
|
@ -14,9 +14,9 @@ export default function App() {
|
|||||||
<Router>
|
<Router>
|
||||||
<div>
|
<div>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/" component={ RegisterPage } />
|
<Route exact path="/newuser/" component={ RegisterPage } />
|
||||||
{/*<Route path="/login" component={ LoginPage } />*/}
|
{/*<Route path="/login" component={ LoginPage } />*/}
|
||||||
<Route path="/register" component={ RegisterPage } />
|
<Route path="/newuser/register" component={ RegisterPage } />
|
||||||
{/*<Route path="/forget-password" component={ ForgetPasswordPage } />*/}
|
{/*<Route path="/forget-password" component={ ForgetPasswordPage } />*/}
|
||||||
{/*<Route path="/home" component={ HomePage } />*/}
|
{/*<Route path="/home" component={ HomePage } />*/}
|
||||||
</Switch>
|
</Switch>
|
||||||
|
@ -13,6 +13,9 @@ export default function SignUpPage() {
|
|||||||
try {
|
try {
|
||||||
let res = await fetch("/register", {
|
let res = await fetch("/register", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
username: username,
|
username: username,
|
||||||
email: email,
|
email: email,
|
||||||
@ -20,7 +23,7 @@ export default function SignUpPage() {
|
|||||||
});
|
});
|
||||||
let resJson = await res.json();
|
let resJson = await res.json();
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
setMessage("User created successfully");
|
setMessage(`API Key: ${resJson['api-key']}`);
|
||||||
} else {
|
} else {
|
||||||
setMessage("Some error occured");
|
setMessage("Some error occured");
|
||||||
}
|
}
|
||||||
@ -32,7 +35,7 @@ export default function SignUpPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="text-center m-5-auto">
|
<div className="text-center m-5-auto">
|
||||||
<h2>Join us</h2>
|
{/*<h2>Join us</h2>*/}
|
||||||
{/*<h5>Create your personal account</h5>*/}
|
{/*<h5>Create your personal account</h5>*/}
|
||||||
<form onSubmit={handleSubmit} action="">
|
<form onSubmit={handleSubmit} action="">
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
Reference in New Issue
Block a user