diff --git a/src/assets/images/bg-sky-blue.jpg b/src/assets/images/bg-sky-blue.jpg new file mode 100644 index 0000000..9f8ca49 Binary files /dev/null and b/src/assets/images/bg-sky-blue.jpg differ diff --git a/src/components/AuthPages/AuthRedirect/Redirect.jsx b/src/components/AuthPages/AuthRedirect/Redirect.jsx index 22a5c84..32a3c49 100644 --- a/src/components/AuthPages/AuthRedirect/Redirect.jsx +++ b/src/components/AuthPages/AuthRedirect/Redirect.jsx @@ -1,9 +1,15 @@ -import React, {useState, useEffect} from 'react' -import { useLocation, useNavigate } from 'react-router-dom' +import React, { useEffect } from 'react'; +import { useLocation, useNavigate } from 'react-router-dom'; +import usersService from '../../../services/UsersService'; +import {updateUserDetails} from "../../../store/UserDetails"; +import { useDispatch } from "react-redux"; +import AuthLayout from "../AuthLayout"; function Redirect() { const location = useLocation(); const navigate = useNavigate(); + const userApi = new usersService(); + const dispatch = useDispatch() const queryParams = new URLSearchParams(location?.search); const codeResponse = queryParams.get("code"); @@ -13,11 +19,48 @@ function Redirect() { navigate('/login', {replace: true}) return } - console.log(codeResponse) + console.log(codeResponse); + /* + POST /token HTTP/1.1 + Host: oauth2.googleapis.com + Content-Type: application/x-www-form-urlencoded + + code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7& + client_id=your_client_id& + client_secret=your_client_secret& + redirect_uri=https%3A//oauth2.example.com/code& + grant_type=authorization_code + */ + var reqData = { + auth_type: "GOOGLE", + code: codeResponse, + redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL, + }; + userApi + .authStart(reqData) + .then((res) => { + if (res.status != 200) { + navigate('/login', {replace: true}) + return; + } + + localStorage.setItem("member_id", `${res.data.member_id}`); + localStorage.setItem("uid", `${res.data.uid}`); + localStorage.setItem("session_token", `${res.data.session}`); + dispatch(updateUserDetails({...res.data, loggedIn:true})); + navigate('/', {replace: true}) + + }) + .catch((error) => { + navigate('/login', {replace: true}) + console.log(error); + }); },[]) return ( -
Redirecting ...
+ +
Redirecting ...
+
) } -export default Redirect \ No newline at end of file +export default Redirect diff --git a/src/components/AuthPages/VerifyLink/index.jsx b/src/components/AuthPages/VerifyLink/index.jsx index 81b5f53..3ff67fc 100644 --- a/src/components/AuthPages/VerifyLink/index.jsx +++ b/src/components/AuthPages/VerifyLink/index.jsx @@ -86,10 +86,14 @@ export default function VerifyLink() { const verifyRes = await userApi.verifyEmail(code); if (verifyRes.status === 200) { let { data } = verifyRes; - + console.log('TESTING VERIFY',data) if ( data && - data.internal_return >= 0 && + data.internal_return >= 0 && + data.status == 0 && + data.pending_id != '' && + data.pending_uid != '' && + data.username != '' && data.status_text === "Link Verified" ) { setPageLoader(false); diff --git a/src/components/Cards/FamilyActiveJobsCard.jsx b/src/components/Cards/FamilyActiveJobsCard.jsx index d652b71..291ed52 100644 --- a/src/components/Cards/FamilyActiveJobsCard.jsx +++ b/src/components/Cards/FamilyActiveJobsCard.jsx @@ -21,7 +21,8 @@ export default function FamilyActiveJobsCard({ datas, hidden = false }) { toast.warn("Remove to Favorite List"); } }; - +//debugger; + const bannerName = datas.banner == null ?'default.jpg':datas.banner; return (
@@ -32,7 +33,7 @@ export default function FamilyActiveJobsCard({ datas, hidden = false }) { className="thumbnail w-full h-full rounded-xl overflow-hidden px-4 pt-4" style={{ background: `url(${localImgLoad( - `images/taskbanners/${datas.banner}` + `images/taskbanners/${bannerName}` )}) center / contain no-repeat`, }} > diff --git a/src/components/Cards/HomeBannerOffersCard.jsx b/src/components/Cards/HomeBannerOffersCard.jsx index 4ba0dad..72f4a58 100644 --- a/src/components/Cards/HomeBannerOffersCard.jsx +++ b/src/components/Cards/HomeBannerOffersCard.jsx @@ -17,21 +17,21 @@ export default function HomeBannerOffersCard(props) { return ( -
+
-
-

+
+

{props.itemData.title}

-
+
{props.itemData.description}