Commit dd0c3b77 authored by Ben Anderson's avatar Ben Anderson

Added google SSO ID

parent 928022d4
......@@ -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
......
......@@ -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;
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;
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