Skip to content

Commit aa828ad

Browse files
committed
Enable SIWE
1 parent 956f479 commit aa828ad

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

src/lib/providers/Web3Provider.tsx

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import Favicon from '@assets/favicon.png';
2-
import { config, domains, environment, projectId } from '@lib/config';
2+
import { accessAuth } from '@lib/api/backend';
3+
import { config, projectId } from '@lib/config';
34
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
45
import { EthAddress } from '@typedefs/blockchain';
56
import { ConnectKitProvider, getDefaultConfig, SIWEConfig, SIWEProvider } from 'connectkit';
67
import { generateNonce, SiweMessage } from 'siwe';
78
import { createConfig, WagmiProvider } from 'wagmi';
8-
import { routePath } from '../routes/route-paths';
99

1010
const siweConfig: SIWEConfig = {
1111
getNonce: async () => {
@@ -35,11 +35,7 @@ const siweConfig: SIWEConfig = {
3535
const chainId = siweMessage.chainId;
3636
const address = siweMessage.address;
3737

38-
const response = {
39-
accessToken: '123',
40-
refreshToken: '456',
41-
expiration: 2819859200,
42-
}; // TODO: Remove (SIWE disabled)
38+
const response = await accessAuth({ message, signature });
4339

4440
localStorage.setItem('chainId', chainId.toString());
4541
localStorage.setItem('address', address);
@@ -119,26 +115,6 @@ export const Web3Provider = ({ children }) => {
119115
'--ck-connectbutton-font-weight': '600',
120116
}}
121117
options={{
122-
disclaimer: (
123-
<>
124-
By connecting your wallet you agree to the{' '}
125-
<a
126-
target="_blank"
127-
rel="noopener noreferrer"
128-
href={`https://${domains[environment]}${routePath.termsAndConditions}`}
129-
>
130-
Terms & Conditions
131-
</a>{' '}
132-
and{' '}
133-
<a
134-
target="_blank"
135-
rel="noopener noreferrer"
136-
href={`https://${domains[environment]}${routePath.privacyPolicy}`}
137-
>
138-
Privacy Policy
139-
</a>
140-
</>
141-
),
142118
enforceSupportedChains: true,
143119
}}
144120
>

0 commit comments

Comments
 (0)