Skip to content

323 - JWT authentication #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions rair-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"prepare": "cd ../ && husky install ./minting-marketplace/.husky"
},
"dependencies": {
"@account-kit/core": "^4.11.0",
"@account-kit/infra": "^4.11.0",
"@account-kit/signer": "^4.11.0",
"@account-kit/core": "^4.13.0",
"@account-kit/infra": "^4.13.0",
"@account-kit/signer": "^4.13.0",
"@alchemy/aa-accounts": "^3.19.0",
"@alchemy/aa-alchemy": "^3.19.0",
"@alchemy/aa-core": "^3.19.0",
Expand All @@ -30,33 +30,35 @@
"@fortawesome/react-fontawesome": "^0.2.2",
"@getyoti/react-face-capture": "^2.3.1",
"@metamask/onboarding": "^1.0.1",
"@metamask/providers": "^14.0.2",
"@metamask/providers": "^22.1.0",
"@mui/icons-material": "^5.16.7",
"@mui/material": "^5.16.7",
"@react-three/drei": "^10.0.7",
"@react-three/fiber": "^9.1.2",
"@reduxjs/toolkit": "^2.5.1",
"@sentry/browser": "^7.85.0",
"@sentry/react": "^7.85.0",
"@wagmi/core": "^2.16.3",
"@walletconnect/sign-client": "^2.14.0",
"@walletconnect/utils": "^2.14.0",
"@web3auth/base": "^9.5.3",
"@web3auth/modal": "^9.5.3",
"alchemy-sdk": "^3.4.1",
"@web3auth/base": "^9.6.0",
"@web3auth/modal": "^9.6.0",
"alchemy-sdk": "^3.5.3",
"analytics": "^0.8.14",
"axios": "^1.7.9",
"bootstrap": "^5.3.3",
"ethers": "^6.13.5",
"global": "^4.4.0",
"moment-timezone": "^0.5.45",
"prettier": "^3.4.2",
"prettier": "^3.5.1",
"react": "^18.3.1",
"react-accessible-accordion": "^5.0.0",
"react-dom": "^18.3.1",
"react-dropzone": "^14.3.5",
"react-ga": "^3.3.1",
"react-helmet-async": "^2.0.5",
"react-hook-form": "^7.54.2",
"react-hot-toast": "^2.5.1",
"react-hot-toast": "^2.5.2",
"react-modal": "^3.16.3",
"react-moment": "^1.1.3",
"react-multi-carousel": "^2.8.5",
Expand All @@ -73,14 +75,16 @@
"styled-components": "^6.1.14",
"sweetalert2": "^11.10.1",
"sweetalert2-react-content": "^5.1.0",
"three": "^0.176.0",
"three-gif-loader": "^1.1.0",
"use-debounce": "^10.0.4",
"use-state-if-mounted": "^1.0.7",
"uuid": "^11.0.4",
"video.js": "^8.17.3",
"videojs-contrib-quality-levels": "^4.0.0",
"videojs-hls-quality-selector": "^1.1.4",
"viem": "^2.22.17",
"vite-plugin-radar": "^0.9.6",
"viem": "^2.23.2",
"vite-plugin-radar": "^0.10.1",
"vite-plugin-svgr": "^4.2.0",
"wagmi": "^2.14.9",
"wicg-inert": "^3.1.3",
Expand All @@ -107,7 +111,10 @@
"eslint-plugin-simple-import-sort": "^12.1.1",
"husky": "^9.1.7",
"typescript": "^5.7.3",
"vite": "^6.0.11",
"vite-plugin-node-polyfills": "^0.23.0"
"vite": "^7.0.6",
"vite-plugin-node-polyfills": "^0.24.0"
},
"resolutions": {
"@types/react": "^18.0.21"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const MediaUpload: React.FC<IMediaUpload> = () => {
}, [currentUserAddress]);

const handleNewUserStatus = useCallback(async () => {
if (!mediaUploadedList.length) {
return;
}
const requestContract = await rFetch('/api/contracts/full?itemsPerPage=5');
const { success, contracts } = await rFetch(
`/api/contracts/full?itemsPerPage=${requestContract.totalNumber || '5'}`
Expand All @@ -83,7 +86,7 @@ const MediaUpload: React.FC<IMediaUpload> = () => {
setNewUserStatus(false);
}
}
}, [currentUserAddress]);
}, [currentUserAddress, mediaUploadedList]);

const onMediaDrop = (media) => {
let aux = [...mediaList];
Expand Down
90 changes: 6 additions & 84 deletions rair-front/src/components/Header/AdminPanel/AdminPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,7 @@ const AdminPanel = ({ creatorViewsDisabled, adminPanel, setAdminPanel }) => {
{' '}
<div>
<FontAwesomeIcon
style={{
color:
import.meta.env.VITE_TESTNET === 'true'
? `${
iconColor === '#1486c5'
? '#F95631'
: iconColor
}`
: `${
iconColor === '#1486c5'
? '#E882D5'
: iconColor
}`
}}
style={{ color: iconColor }}
icon={faCog}
/>
</div>
Expand All @@ -73,20 +60,7 @@ const AdminPanel = ({ creatorViewsDisabled, adminPanel, setAdminPanel }) => {
{' '}
<div>
<FontAwesomeIcon
style={{
color:
import.meta.env.VITE_TESTNET === 'true'
? `${
iconColor === '#1486c5'
? '#F95631'
: iconColor
}`
: `${
iconColor === '#1486c5'
? '#E882D5'
: iconColor
}`
}}
style={{ color: iconColor }}
icon={faIdCard}
/>
</div>
Expand All @@ -102,20 +76,7 @@ const AdminPanel = ({ creatorViewsDisabled, adminPanel, setAdminPanel }) => {
title="Import / Export / Transfer">
<div>
<FontAwesomeIcon
style={{
color:
import.meta.env.VITE_TESTNET === 'true'
? `${
iconColor === '#1486c5'
? '#F95631'
: iconColor
}`
: `${
iconColor === '#1486c5'
? '#E882D5'
: iconColor
}`
}}
style={{ color: iconColor }}
icon={faCity}
/>
</div>
Expand All @@ -129,20 +90,7 @@ const AdminPanel = ({ creatorViewsDisabled, adminPanel, setAdminPanel }) => {
<TooltipBox position={'top'} title="Streaming">
<div style={{ width: '70px' }}>
<FontAwesomeIcon
style={{
color:
import.meta.env.VITE_TESTNET === 'true'
? `${
iconColor === '#1486c5'
? '#F95631'
: iconColor
}`
: `${
iconColor === '#1486c5'
? '#E882D5'
: iconColor
}`
}}
style={{ color: iconColor }}
icon={faFilm}
/>
</div>
Expand All @@ -156,20 +104,7 @@ const AdminPanel = ({ creatorViewsDisabled, adminPanel, setAdminPanel }) => {
<TooltipBox position={'top'} title="Old Market (diamond)">
<div style={{ width: '70px' }}>
<FontAwesomeIcon
style={{
color:
import.meta.env.VITE_TESTNET === 'true'
? `${
iconColor === '#1486c5'
? '#F95631'
: iconColor
}`
: `${
iconColor === '#1486c5'
? '#E882D5'
: iconColor
}`
}}
style={{ color: iconColor }}
icon={faGem}
/>
</div>
Expand All @@ -183,20 +118,7 @@ const AdminPanel = ({ creatorViewsDisabled, adminPanel, setAdminPanel }) => {
<TooltipBox position={'top'} title="Old Market (classic)">
<div style={{ width: '70px' }}>
<FontAwesomeIcon
style={{
color:
import.meta.env.VITE_TESTNET === 'true'
? `${
iconColor === '#1486c5'
? '#F95631'
: iconColor
}`
: `${
iconColor === '#1486c5'
? '#E882D5'
: iconColor
}`
}}
style={{ color: iconColor }}
icon={faShoppingCart}
/>
</div>
Expand Down
12 changes: 7 additions & 5 deletions rair-front/src/components/Header/MainHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import useComponentVisible from '../../hooks/useComponentVisible';
import useConnectUser from '../../hooks/useConnectUser';
import { useAppDispatch, useAppSelector } from '../../hooks/useReduxHooks';
import { dataStatuses } from '../../redux/commonTypes';
import { clearResults, startSearch } from '../../redux/searchbarSlice';
import { fetchNotifications } from '../../redux/notificationsSlice';
import { clearResults, startSearch } from '../../redux/searchbarSlice';
import InputField from '../common/InputField';
import { TooltipBox } from '../common/Tooltip/TooltipBox';
import MainLogo from '../GroupLogos/MainLogo';
Expand Down Expand Up @@ -63,7 +63,9 @@ const MainHeader: FC<IMainHeader> = ({
(store) => store.user
);

const { totalCount: notificationCount, notifications } = useAppSelector(store => store.notifications);
const { totalCount: notificationCount, notifications } = useAppSelector(
(store) => store.notifications
);

const { currentUserAddress } = useAppSelector((store) => store.web3);

Expand Down Expand Up @@ -121,7 +123,7 @@ const MainHeader: FC<IMainHeader> = ({
};

useEffect(() => {
if(currentUserAddress && isLoggedIn) {
if (currentUserAddress && isLoggedIn) {
dispatch(fetchNotifications(0));
}
}, [currentUserAddress, isLoggedIn]);
Expand Down Expand Up @@ -166,7 +168,7 @@ const MainHeader: FC<IMainHeader> = ({

useEffect(() => {
dispatch(fetchNotifications());
}, [])
}, []);

return (
<HeaderContainer
Expand Down Expand Up @@ -287,7 +289,7 @@ const MainHeader: FC<IMainHeader> = ({
<h5>Users</h5>
{searchResults?.users?.map((item, index) => (
<div
key={Number(index) + Math.random()}
key={index}
className="data-find"
onClick={() => goToExactlyUser(item.publicAddress)}>
{item.avatar ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,11 @@ const SerialNumberBuySell: React.FC<ISerialNumberBuySell> = ({
),
showConfirmButton: false,
showCloseButton: true,
customClass: `resale-pop-up-custom ${
primaryColor === 'rhyno' ? 'rhyno' : ''
}`
customClass: {
container: `resale-pop-up-custom ${
primaryColor === 'rhyno' ? 'rhyno' : ''
}`
}
});
}}
className="nft-item-sell-buton">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,11 @@ const NftItemForCollectionViewComponent: React.FC<
),
showConfirmButton: false,
showCloseButton: true,
customClass: `resale-pop-up-custom ${
primaryColor === 'rhyno' ? 'rhyno' : ''
}`
customClass: {
container: `resale-pop-up-custom ${
primaryColor === 'rhyno' ? 'rhyno' : ''
}`
}
});
}}
className="nft-item-sell-buton">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ const MobileListMenu: React.FC<IMobileListMenu> = ({
const { searchResults } = useAppSelector((store) => store.searchbar);
const hotdropsVar = import.meta.env.VITE_TESTNET;

const { iconColor, primaryColor, secondaryColor, isDarkMode } = useAppSelector(
(store) => store.colors
);
const { iconColor, primaryColor, secondaryColor, isDarkMode } =
useAppSelector((store) => store.colors);

const [textSearch, setTextSearch] = useState<string>('');

Expand Down Expand Up @@ -143,8 +142,7 @@ const MobileListMenu: React.FC<IMobileListMenu> = ({
hotdrops={hotdropsVar}
primaryColor={primaryColor}
click={click}
isDarkMode={isDarkMode}
>
isDarkMode={isDarkMode}>
<div>
{activeSearch && (
<>
Expand Down Expand Up @@ -273,7 +271,7 @@ const MobileListMenu: React.FC<IMobileListMenu> = ({
{searchResults?.users.map(
(item: User, index: number) => (
<div
key={Number(index) + Math.random()}
key={index}
className="data-find"
onClick={() => {
toggleMenu();
Expand Down
2 changes: 2 additions & 0 deletions rair-front/src/components/ServerSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useAppDispatch } from '../../hooks/useReduxHooks';
import { loadSettings } from '../../redux/settingsSlice';
import { Contract } from '../../types/databaseTypes';
import { rFetch } from '../../utils/rFetch';
import BackupServerSettings from '../adminViews/BackupServerSettings';

const ServerSettings = () => {
const [contractList, setContractList] = useState<
Expand Down Expand Up @@ -65,6 +66,7 @@ const ServerSettings = () => {
<CorsSettings />
<hr className="my-5" />
<ContractManager {...{ contractList, getContractList }} />
<BackupServerSettings />
</div>
);
};
Expand Down
Loading