Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
A
Aqbits Trace Code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mai Thanh Cong
Aqbits Trace Code
Commits
277636bf
Commit
277636bf
authored
Jul 07, 2021
by
Mai Thanh Cong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change client id
parent
b38ec7d8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
25 deletions
+15
-25
.env
.env
+1
-1
src/HomePage.js
src/HomePage.js
+2
-1
src/components/Profile/AddProduct.js
src/components/Profile/AddProduct.js
+0
-1
src/services/AuthServices.js
src/services/AuthServices.js
+1
-5
src/services/Signin.js
src/services/Signin.js
+11
-17
No files found.
.env
View file @
277636bf
#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
src/HomePage.js
View file @
277636bf
...
@@ -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} />
...
...
src/components/Profile/AddProduct.js
View file @
277636bf
...
@@ -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
(),
...
...
src/services/AuthServices.js
View file @
277636bf
...
@@ -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
"
);
...
...
src/services/Signin.js
View file @
277636bf
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment