From 8187d157723919bed5511f70ba8600a02ec94a78 Mon Sep 17 00:00:00 2001 From: manangouhari <31039184+manangouhari@users.noreply.github.com> Date: Wed, 3 Mar 2021 20:35:52 +0530 Subject: [PATCH] auth bug solved (#209) --- src/pages/tezos/marketplace.js | 7 ++++--- src/pages/tezos/profile.js | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pages/tezos/marketplace.js b/src/pages/tezos/marketplace.js index 4fe98cde..df5dd1f6 100644 --- a/src/pages/tezos/marketplace.js +++ b/src/pages/tezos/marketplace.js @@ -12,7 +12,7 @@ import Footer from 'src/components/Footer'; import CryptobotCard from 'src/components/CryptobotCard'; import uniqBy from 'lodash.uniqby'; import Loader from 'react-loader-spinner'; - +import userAtom from 'src/atoms/user-atom'; import isUserAtom from 'src/atoms/is-user-atom'; import { useAtom } from 'jotai'; @@ -22,6 +22,7 @@ const Marketplace = () => { const [sortBy, updateSortBy] = useState('offerDate'); const [nftList, updateNftList] = useState([]); const [xtzPrice, updateXtzPrice] = useState(null); + const [user] = useAtom(userAtom); const [isUser] = useAtom(isUserAtom); const allNFTS = useAsync(async () => { @@ -91,8 +92,8 @@ const Marketplace = () => { }, []); useEffect(() => { - // console.log(user, isUser); - if (!isUser) { + console.log(user, isUser); + if (!isUser || !user?.verified) { const url = typeof window !== 'undefined' ? window.location.pathname : '/tezos'; navigate('/auth', { state: { pathname: url } }); diff --git a/src/pages/tezos/profile.js b/src/pages/tezos/profile.js index be55e75a..cf5e325a 100644 --- a/src/pages/tezos/profile.js +++ b/src/pages/tezos/profile.js @@ -32,12 +32,12 @@ const Empty = () => {
@@ -52,8 +52,8 @@ function Profile() { const [isUser] = useAtom(isUserAtom); useEffect(() => { - // console.log(user, isUser); - if (!isUser) { + console.log(user, isUser); + if (!isUser || !user?.verified) { const url = typeof window !== 'undefined' ? window.location.pathname : '/tezos'; navigate('/auth', { state: { pathname: url } });