Commit 277636bf authored by Mai Thanh Cong's avatar Mai Thanh Cong

change client id

parent b38ec7d8
#config
REACT_APP_AWS_USER_POOL_ID = us-east-1_c1uad9xyt
REACT_APP_AWS_CLIENT_ID = 339mutkibblh97ojfjgti8gei7
REACT_APP_AWS_CLIENT_ID = 4isv4m9h8q29b7a8m87gkath31
REACT_APP_BASE_URL_AQBITS_TRACE_CODE = https://f26svz60d8.execute-api.us-east-1.amazonaws.com/api
\ No newline at end of file
......@@ -26,7 +26,7 @@ import { Routes } from "reoutes";
const RouteWithLoader = ({ component: Component, ...rest }) => {
return (
<Route {...rest} render={props => authServices.isAuthenticated() === true ? <Component {...props} /> : <Redirect to={{ pathname: '/login-page' }} />} />
<Route {...rest} render={props => authServices.isAuthenticated() ? <Component {...props} /> : <Redirect to={{ pathname: '/login-page' }} />} />
);
};
......@@ -35,6 +35,7 @@ export default () => (
<Route exact path="/login-page" component={Signin} />
<RouteWithLoader exact path="/" component={SearchProfile} />
<RouteWithLoader exact path="/profile" component={SearchProfile} />
<RouteWithLoader exact path="/profile/add" component={AddProfile} />
<RouteWithLoader exact path="/profile/add-product" component={AddProduct} />
<RouteWithLoader exact path="/profile/:code" component={DetailProfile} />
......
......@@ -33,7 +33,6 @@ const AddProduct = () => {
const onHandleAddProduct = (event) => {
event.preventDefault();
debugger
const getTime = new Date().getTime();
const params = {
product_id: uuidv4(),
......
......@@ -143,11 +143,7 @@ export const authServices = {
});
},
isAuthenticated: () => {
if(localStorage.getItem("access_token") && localStorage.getItem("id_token")){
return true;
}else {
return false;
}
return localStorage.getItem("access_token") && localStorage.getItem("id_token");
},
logout: () => {
localStorage.removeItem("access_token");
......
......@@ -87,6 +87,7 @@ export default () => {
{/* <DemoNavbar /> */}
<main>
{/* <MainBanner /> */}
<section className="section section-shaped section-lg">
<div className="shape shape-style-1 bg-gradient-default">
<span />
......@@ -104,12 +105,18 @@ export default () => {
) : (
false
)}
{loading ? (
<div className="text-center mb-3">
<Spinner color="primary" />
</div>
) : (
false
)}
<Row className="justify-content-center">
<Col lg="5">
<Card className="bg-secondary shadow border-0">
<CardBody className="px-lg-5 py-lg-5">
<Form role="form" onSubmit={onHandleLogin}>
<FormGroup id="email" className="mb-3">
<InputGroup className="input-group-alternative">
<InputGroupAddon addonType="prepend">
......@@ -118,17 +125,10 @@ export default () => {
</InputGroupText>
</InputGroupAddon>
<Input placeholder="Email" type="text"
value={email} onChange={(e) => setEmail(e.target.value)} {...validEmail ? "invalid" : ""} />
<FormFeedback valid>{validEmail}</FormFeedback>
value={email} onChange={(e) => setEmail(e.target.value)} />
<FormFeedback invalid>{validEmail ? "Không đúng định dạng email" : ""}</FormFeedback>
</InputGroup>
{/* <Form.Control.Feedback
type="invalid"
className="invalid-feedback"
>
{validEmail ? "Please input validate email" : false}
</Form.Control.Feedback> */}
</FormGroup>
<FormGroup id="password">
<InputGroup className="input-group-alternative">
<InputGroupAddon addonType="prepend">
......@@ -154,13 +154,7 @@ export default () => {
Sign in
</Button>
</div>
{loading ? (
<div className="text-center">
<Spinner color="primary" />
</div>
) : (
false
)}
</Form>
</CardBody>
</Card>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment