Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/Users-Wrench into enable-and-active-jobs
This commit was merged in pull request #103.
This commit is contained in:
@@ -34,5 +34,17 @@ REACT_APP_ITEM_PER_PAGE=5
|
|||||||
# Empty Listings
|
# Empty Listings
|
||||||
REACT_APP_ZERO_STATE=0
|
REACT_APP_ZERO_STATE=0
|
||||||
|
|
||||||
|
#REACT_APP_GOOGLE_CLIENT_ID_RET=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com
|
||||||
|
|
||||||
|
REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com
|
||||||
|
REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm
|
||||||
|
REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
|
||||||
|
|
||||||
|
|
||||||
|
REACT_APP_FACEBOOK_CLIENT_ID=390204307987009
|
||||||
|
REACT_APP_FACEBOOK_CLIENT_SECRET=19f778e312f2ab96d147bacb612910c2
|
||||||
|
REACT_APP_FACEBOOK_CLIENT_SCOPE="email, public_profile"
|
||||||
|
|
||||||
|
|
||||||
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
||||||
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
||||||
|
|||||||
@@ -33,3 +33,5 @@ REACT_APP_ITEM_PER_PAGE=5
|
|||||||
|
|
||||||
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
#apigate.lotus.g1.wrenchboard.com:76.209.103.227
|
||||||
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
||||||
|
|
||||||
|
REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com
|
||||||
@@ -33,3 +33,5 @@ REACT_APP_ITEM_PER_PAGE=5
|
|||||||
|
|
||||||
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
||||||
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
#apigate.orion.g1.wrenchboard.com:76.209.103.227
|
||||||
|
|
||||||
|
REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com
|
||||||
@@ -8,8 +8,8 @@ import WrenchBoard from "../../../assets/images/wrenchboard.png";
|
|||||||
import usersService from "../../../services/UsersService";
|
import usersService from "../../../services/UsersService";
|
||||||
import InputCom from "../../Helpers/Inputs/InputCom";
|
import InputCom from "../../Helpers/Inputs/InputCom";
|
||||||
import AuthLayout from "../AuthLayout";
|
import AuthLayout from "../AuthLayout";
|
||||||
//import { GoogleOAuthProvider } from '@react-oauth/google';
|
// import { GoogleOAuthProvider } from '@react-oauth/google';
|
||||||
// import { googleLogout, useGoogleLogin } from '@react-oauth/google';
|
import { googleLogout, useGoogleLogin } from '@react-oauth/google';
|
||||||
|
|
||||||
import { useDispatch } from "react-redux";
|
import { useDispatch } from "react-redux";
|
||||||
import { updateUserDetails } from "../../../store/UserDetails";
|
import { updateUserDetails } from "../../../store/UserDetails";
|
||||||
@@ -120,6 +120,18 @@ export default function Login() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const googleLogin = useGoogleLogin({
|
||||||
|
onSuccess: async (tokenResponse) => {
|
||||||
|
console.log(tokenResponse);
|
||||||
|
// const userInfo = await axios.get(
|
||||||
|
// 'https://www.googleapis.com/oauth2/v3/userinfo',
|
||||||
|
// { headers: { Authorization: `Bearer ${tokenResponse.access_token}` } },
|
||||||
|
// );
|
||||||
|
// console.log(userInfo);
|
||||||
|
},
|
||||||
|
onError: errorResponse => console.log(errorResponse),
|
||||||
|
});
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setMail('')
|
setMail('')
|
||||||
setPassword('')
|
setPassword('')
|
||||||
@@ -246,7 +258,7 @@ export default function Login() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
|
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
|
||||||
<BrandBtn link="#" imgSrc={googleLogo} brand="Google" />
|
<BrandBtn link="#" imgSrc={googleLogo} brand="Google" onClick={googleLogin} />
|
||||||
<BrandBtn link="#" imgSrc={appleLogo} brand="Apple" />
|
<BrandBtn link="#" imgSrc={appleLogo} brand="Apple" />
|
||||||
</div>
|
</div>
|
||||||
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
|
<div className="sm:flex sm:justify-between sm:items-center sm:space-x-2">
|
||||||
@@ -347,10 +359,10 @@ export default function Login() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const BrandBtn = ({ link, imgSrc, brand }) => {
|
const BrandBtn = ({ link, imgSrc, brand, onClick }) => {
|
||||||
const doGoogle = async () => {
|
// const doGoogle = async () => {
|
||||||
alert("start google");
|
// alert("start google");
|
||||||
};
|
// };
|
||||||
|
|
||||||
// onSuccess: (codeResponse) => setUser(codeResponse),
|
// onSuccess: (codeResponse) => setUser(codeResponse),
|
||||||
|
|
||||||
@@ -359,26 +371,26 @@ const BrandBtn = ({ link, imgSrc, brand }) => {
|
|||||||
// onError: (error) => console.log('Login Failed:', error)
|
// onError: (error) => console.log('Login Failed:', error)
|
||||||
// });
|
// });
|
||||||
|
|
||||||
const doApple = async () => {
|
// const doApple = async () => {
|
||||||
alert("start apple");
|
// alert("start apple");
|
||||||
};
|
// };
|
||||||
|
|
||||||
const doFacebook = async () => {
|
// const doFacebook = async () => {
|
||||||
alert("start facebook");
|
// alert("start facebook");
|
||||||
};
|
// };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full sm:w-1/2 flex justify-center bottomMargin">
|
<div className="w-full sm:w-1/2 flex justify-center bottomMargin">
|
||||||
<a
|
<button
|
||||||
// onClick={doGoogle}
|
onClick={onClick}
|
||||||
href="#dd"
|
// href="#dd"
|
||||||
className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 dark:bg-[#11131F] items-center font-medium cursor-pointer"
|
className="w-full border border-light-purple dark:border-[#5356fb29] rounded-[0.475rem] h-[48px] flex justify-center bg-[#FAFAFA] hover:bg-[#eff2f5] hover:text-[#7e8299] transition duration-300 dark:bg-[#11131F] items-center font-medium cursor-pointer"
|
||||||
>
|
>
|
||||||
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
|
<img className="mr-3 h-6" src={imgSrc} alt="logo-icon(s)" />
|
||||||
<span className="text-lg text-thin-light-gray font-normal text-[15px]">
|
<span className="text-lg text-thin-light-gray font-normal text-[15px]">
|
||||||
Continue with {brand}
|
Continue with {brand}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
+5
-1
@@ -6,11 +6,15 @@ import App from "./App";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import store from "./store/store";
|
import store from "./store/store";
|
||||||
|
|
||||||
|
import { GoogleOAuthProvider } from '@react-oauth/google';
|
||||||
|
|
||||||
const root = document.getElementById("root");
|
const root = document.getElementById("root");
|
||||||
ReactDOM.createRoot(root).render(
|
ReactDOM.createRoot(root).render(
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<App />
|
<GoogleOAuthProvider clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID}>
|
||||||
|
<App />
|
||||||
|
</GoogleOAuthProvider>
|
||||||
</Provider>
|
</Provider>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user