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
Hide 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
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
src/HomePage.js
View file @
277636bf
...
...
@@ -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} />
...
...
src/components/Profile/AddProduct.js
View file @
277636bf
...
...
@@ -33,7 +33,6 @@ const AddProduct = () => {
const
onHandleAddProduct
=
(
event
)
=>
{
event
.
preventDefault
();
debugger
const
getTime
=
new
Date
().
getTime
();
const
params
=
{
product_id
:
uuidv4
(),
...
...
src/services/AuthServices.js
View file @
277636bf
...
...
@@ -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
"
);
...
...
src/services/Signin.js
View file @
277636bf
...
...
@@ -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
>
...
...
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