Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inventory-promotion-react
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ascend
inventory-promotion-react
Commits
dd0c3b77
Commit
dd0c3b77
authored
May 13, 2021
by
Ben Anderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added google SSO ID
parent
928022d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
25 deletions
+26
-25
deployment.yaml
deployment.yaml
+1
-1
LoginButton.jsx
src/component/session/LoginButton.jsx
+7
-5
LogoutButton.jsx
src/component/session/LogoutButton.jsx
+18
-19
No files found.
deployment.yaml
View file @
dd0c3b77
...
...
@@ -14,7 +14,7 @@ spec:
spec
:
containers
:
-
name
:
afp-inventory-ui-container
image
:
nexus.mynisum.com/afp-inventory-ui:
8
image
:
nexus.mynisum.com/afp-inventory-ui:
9
imagePullPolicy
:
Always
ports
:
-
containerPort
:
8081
...
...
src/component/session/LoginButton.jsx
View file @
dd0c3b77
...
...
@@ -4,7 +4,9 @@ import "./LoginButtonPage.css";
import
{
AuthContext
}
from
"../../App"
;
const
google_ClientID
=
process
.
env
.
REACT_APP_GOOGLE_CLIENT_ID
;
const
clientId
=
`
${
google_ClientID
}
.apps.googleusercontent.com`
;
// const clientId = `${google_ClientID}.apps.googleusercontent.com`;
const
clientId
=
"925243198137-7066age7c8m7sfuufcheruoa43ng55ts.apps.googleusercontent.com"
;
function
LoginButton
({}){
...
...
@@ -12,7 +14,7 @@ function LoginButton({}){
const
onSuccessLogin
=
(
res
)
=>
{
setIsLoggedIn
(
true
);
const
{
tokenId
,
profileObj
}
=
res
;
const
{
tokenId
,
profileObj
}
=
res
;
};
const
onFailure
=
(
res
)
=>
{
...
...
@@ -25,8 +27,8 @@ function LoginButton({}){
<
div
className=
"loginContainer"
>
<
h1
>
Welcome to Ascend Inventory
</
h1
>
<
h3
>
Please Login with Google credentials
</
h3
>
<
GoogleLogin
<
GoogleLogin
clientId=
{
clientId
}
buttonText=
"Sign-in with Google"
onSuccess=
{
onSuccessLogin
}
...
...
@@ -38,4 +40,4 @@ function LoginButton({}){
);
}
export
default
LoginButton
;
\ No newline at end of file
export
default
LoginButton
;
src/component/session/LogoutButton.jsx
View file @
dd0c3b77
import
React
,
{
useContext
}
from
'react'
;
import
{
GoogleLogout
}
from
'react-google-login'
;
import
{
AuthContext
}
from
"../../App"
;
import
React
,
{
useContext
}
from
"react"
;
import
{
GoogleLogout
}
from
"react-google-login"
;
import
{
AuthContext
}
from
"../../App"
;
const
google_ClientID
=
process
.
env
.
REACT_APP_GOOGLE_CLIENT_ID
;
const
clientId
=
`
${
google_ClientID
}
.apps.googleusercontent.com`
;
const
clientId
=
`
925243198137-7066age7c8m7sfuufcheruoa43ng55ts
.apps.googleusercontent.com`
;
function
LogoutButton
(){
function
LogoutButton
()
{
const
{
isLoggedIn
,
setIsLoggedIn
}
=
useContext
(
AuthContext
);
const
{
isLoggedIn
,
setIsLoggedIn
}
=
useContext
(
AuthContext
);
const
onSuccessLogout
=
(
res
)
=>
{
setIsLoggedIn
(
false
);
};
const
onSuccessLogout
=
(
res
)
=>
{
setIsLoggedIn
(
false
);
}
return
(
<
div
>
<
GoogleLogout
clientId=
{
clientId
}
buttonText=
"Logout"
onLogoutSuccess=
{
onSuccessLogout
}
/>
</
div
>
);
return
(
<
div
>
<
GoogleLogout
clientId=
{
clientId
}
buttonText=
"Logout"
onLogoutSuccess=
{
onSuccessLogout
}
/>
</
div
>
);
}
export
default
LogoutButton
;
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