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

change client id

parent b38ec7d8
#config #config
REACT_APP_AWS_USER_POOL_ID = us-east-1_c1uad9xyt 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 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"; ...@@ -26,7 +26,7 @@ import { Routes } from "reoutes";
const RouteWithLoader = ({ component: Component, ...rest }) => { const RouteWithLoader = ({ component: Component, ...rest }) => {
return ( 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 () => ( ...@@ -35,6 +35,7 @@ export default () => (
<Route exact path="/login-page" component={Signin} /> <Route exact path="/login-page" component={Signin} />
<RouteWithLoader exact path="/" component={SearchProfile} /> <RouteWithLoader exact path="/" component={SearchProfile} />
<RouteWithLoader exact path="/profile" component={SearchProfile} />
<RouteWithLoader exact path="/profile/add" component={AddProfile} /> <RouteWithLoader exact path="/profile/add" component={AddProfile} />
<RouteWithLoader exact path="/profile/add-product" component={AddProduct} /> <RouteWithLoader exact path="/profile/add-product" component={AddProduct} />
<RouteWithLoader exact path="/profile/:code" component={DetailProfile} /> <RouteWithLoader exact path="/profile/:code" component={DetailProfile} />
......
...@@ -33,7 +33,6 @@ const AddProduct = () => { ...@@ -33,7 +33,6 @@ const AddProduct = () => {
const onHandleAddProduct = (event) => { const onHandleAddProduct = (event) => {
event.preventDefault(); event.preventDefault();
debugger
const getTime = new Date().getTime(); const getTime = new Date().getTime();
const params = { const params = {
product_id: uuidv4(), product_id: uuidv4(),
......
...@@ -143,11 +143,7 @@ export const authServices = { ...@@ -143,11 +143,7 @@ export const authServices = {
}); });
}, },
isAuthenticated: () => { isAuthenticated: () => {
if(localStorage.getItem("access_token") && localStorage.getItem("id_token")){ return localStorage.getItem("access_token") && localStorage.getItem("id_token");
return true;
}else {
return false;
}
}, },
logout: () => { logout: () => {
localStorage.removeItem("access_token"); localStorage.removeItem("access_token");
......
...@@ -87,6 +87,7 @@ export default () => { ...@@ -87,6 +87,7 @@ export default () => {
{/* <DemoNavbar /> */} {/* <DemoNavbar /> */}
<main> <main>
{/* <MainBanner /> */} {/* <MainBanner /> */}
<section className="section section-shaped section-lg"> <section className="section section-shaped section-lg">
<div className="shape shape-style-1 bg-gradient-default"> <div className="shape shape-style-1 bg-gradient-default">
<span /> <span />
...@@ -104,12 +105,18 @@ export default () => { ...@@ -104,12 +105,18 @@ export default () => {
) : ( ) : (
false false
)} )}
{loading ? (
<div className="text-center mb-3">
<Spinner color="primary" />
</div>
) : (
false
)}
<Row className="justify-content-center"> <Row className="justify-content-center">
<Col lg="5"> <Col lg="5">
<Card className="bg-secondary shadow border-0"> <Card className="bg-secondary shadow border-0">
<CardBody className="px-lg-5 py-lg-5"> <CardBody className="px-lg-5 py-lg-5">
<Form role="form" onSubmit={onHandleLogin}> <Form role="form" onSubmit={onHandleLogin}>
<FormGroup id="email" className="mb-3"> <FormGroup id="email" className="mb-3">
<InputGroup className="input-group-alternative"> <InputGroup className="input-group-alternative">
<InputGroupAddon addonType="prepend"> <InputGroupAddon addonType="prepend">
...@@ -118,17 +125,10 @@ export default () => { ...@@ -118,17 +125,10 @@ export default () => {
</InputGroupText> </InputGroupText>
</InputGroupAddon> </InputGroupAddon>
<Input placeholder="Email" type="text" <Input placeholder="Email" type="text"
value={email} onChange={(e) => setEmail(e.target.value)} {...validEmail ? "invalid" : ""} /> value={email} onChange={(e) => setEmail(e.target.value)} />
<FormFeedback valid>{validEmail}</FormFeedback> <FormFeedback invalid>{validEmail ? "Không đúng định dạng email" : ""}</FormFeedback>
</InputGroup> </InputGroup>
{/* <Form.Control.Feedback
type="invalid"
className="invalid-feedback"
>
{validEmail ? "Please input validate email" : false}
</Form.Control.Feedback> */}
</FormGroup> </FormGroup>
<FormGroup id="password"> <FormGroup id="password">
<InputGroup className="input-group-alternative"> <InputGroup className="input-group-alternative">
<InputGroupAddon addonType="prepend"> <InputGroupAddon addonType="prepend">
...@@ -154,13 +154,7 @@ export default () => { ...@@ -154,13 +154,7 @@ export default () => {
Sign in Sign in
</Button> </Button>
</div> </div>
{loading ? (
<div className="text-center">
<Spinner color="primary" />
</div>
) : (
false
)}
</Form> </Form>
</CardBody> </CardBody>
</Card> </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