Skip to content

Commit

Permalink
fix: add base url
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecarpini committed Jan 21, 2024
1 parent 6c5e736 commit e4f99b7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion apps/web/src/components/ReservesIncentives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type Props = {

export const ReservesIncentives: React.FC<Props> = ({ address }) => {
const { data: reservesIncentives } = useReservesIncentives();
console.log('fakse');
const formattedReservesIncentives =
reservesIncentives?.formattedReservesIncentives;

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/const/turnkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { WebauthnStamper } from '@turnkey/webauthn-stamper';
import { config } from '@repo/config';

const stamper = new WebauthnStamper({
rpId: 'localhost'
rpId: config.baseUrl || 'localhost'
});

export const passkeyHttpClient = new TurnkeyClient(
Expand Down
6 changes: 5 additions & 1 deletion packages/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type AppConfig = {
alchemyApiKey: string;
walletConnectProjectId: string;
pimlicoApiKey: string;
baseUrl: string;
};

/**
Expand All @@ -18,6 +19,7 @@ const getConfig = (): AppConfig => {
const turnkeyApiPublicKey = import.meta.env.VITE_API_PUBLIC_KEY;
const turnkeyApiPrivateKey = import.meta.env.VITE_API_PRIVATE_KEY;
const alchemyApiKey = import.meta.env.VITE_ALCHEMY_KEY;
const baseUrl = import.meta.env.VITE_BASE_URL;
const walletConnectProjectId = import.meta.env
.VITE_WALLET_CONNECT_PROJECT_ID;
const pimlicoApiKey = import.meta.env.VITE_PIMLICO_API_KEY;
Expand All @@ -34,6 +36,7 @@ const getConfig = (): AppConfig => {
if (!walletConnectProjectId)
throw new Error('VITE_WALLET_CONNECT_PROJECT_ID is not defined');
if (!pimlicoApiKey) throw new Error('VITE_PIMLICO_API_KEY is not defined');
if (!baseUrl) throw new Error('VITE_BASE_URL is not defined');

return {
turnkeyOrganizationId,
Expand All @@ -42,7 +45,8 @@ const getConfig = (): AppConfig => {
turnkeyApiPrivateKey,
alchemyApiKey,
walletConnectProjectId,
pimlicoApiKey
pimlicoApiKey,
baseUrl
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { config } from '@repo/config';
import { WebauthnStamper } from '@turnkey/webauthn-stamper';

const stamper = new WebauthnStamper({
rpId: 'localhost' // TODO - cahnge with url when deployed
rpId: config.baseUrl || 'localhost'
});

export const turnkeyPasskeyClient = () =>
Expand Down
2 changes: 1 addition & 1 deletion packages/lfgho-sdk/src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const useAuth = () => {
const attestation = await getWebAuthnAttestation({
publicKey: {
rp: {
id: 'localhost', // TODO - cahnge with url when deployed
id: config.baseUrl || 'localhost',
name: 'LFGHO SDK'
},
challenge,
Expand Down

0 comments on commit e4f99b7

Please sign in to comment.