Skip to content

Commit

Permalink
chore: use env var to configure
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalavedra committed Nov 26, 2024
1 parent c31e310 commit 3fb52c6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {useState} from 'react';
import {useOpenfort} from '../../hooks/useOpenfort';
import Loading from '../Loading';
import { Button } from '../ui/button';
import { polygonAmoy } from 'viem/chains';

const chainId = Number(process.env.NEXT_PUBLIC_CHAIN_ID);

const AccountRecovery: React.FC = () => {
const {handleRecovery} = useOpenfort();
Expand Down Expand Up @@ -34,7 +35,7 @@ const AccountRecovery: React.FC = () => {
) as HTMLInputElement
).value;
setLoadingPwd(true);
await handleRecovery({method: 'password', password, chainId: polygonAmoy.id});
await handleRecovery({method: 'password', password, chainId: chainId});
setLoadingPwd(false);
}}
>
Expand All @@ -57,7 +58,7 @@ const AccountRecovery: React.FC = () => {
className="bg-white text-black p-2.5 border border-gray-200 rounded-lg w-full hover:bg-gray-100"
onClick={async () => {
setLoadingAut(true);
await handleRecovery({method:'automatic', chainId: polygonAmoy.id});
await handleRecovery({method:'automatic', chainId: chainId});
setLoadingAut(false);
}}
>
Expand Down
1 change: 0 additions & 1 deletion examples/apps/auth-sample/src/pages/connect-wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Head from 'next/head';
import Link from 'next/link';
import {useEffect, useState} from 'react';

import {AuthLayout} from '../components/Layouts/AuthLayout';
import openfort from '../utils/openfortConfig';
import {StatusType, Toast} from '../components/Toasts';
Expand Down
4 changes: 0 additions & 4 deletions examples/apps/auth-sample/src/pages/forgot-password.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import {useState, useEffect} from 'react';

import Head from 'next/head';
import Link from 'next/link';
import {useRouter} from 'next/router';

import {AuthLayout} from '../components/Layouts/AuthLayout';
import {TextField} from '../components/Fields';

import {StatusType, Toast} from '../components/Toasts';

import openfort from '../utils/openfortConfig';
import {getURL} from '../utils/getUrl';
import {AuthPlayerResponse} from '@openfort/openfort-js';
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/auth-sample/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Wallet } from 'lucide-react';
import AccountActions from '@/components/AccountActions/AccountActions';

const HomePage: NextPage = () => {
const {state, handleRecovery} = useOpenfort();
const {state} = useOpenfort();
const [user, setUser] = useState<AuthPlayerResponse | null>(null);
const router = useRouter();
const [message, setMessage] = useState<string>('');
Expand Down
2 changes: 0 additions & 2 deletions examples/apps/auth-sample/src/pages/link-wallet.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import Head from 'next/head';
import Link from 'next/link';
import {useEffect, useState} from 'react';

import {AuthLayout} from '../components/Layouts/AuthLayout';
import openfort from '../utils/openfortConfig';
import {StatusType, Toast} from '../components/Toasts';
import {AuthPlayerResponse} from '@openfort/openfort-js';
import {useRouter} from 'next/router';
import {getWalletButtons} from '../components/WalletConnectButton';
import {Chain, WalletConnector} from '../utils/constants';
import {useAccount} from 'wagmi';

function LinkWalletPage() {
const [user, setUser] = useState<AuthPlayerResponse | null>(null);
Expand Down

0 comments on commit 3fb52c6

Please sign in to comment.