diff --git a/src/modules/atproto/infrastructure/services/FakeAtProtoOAuthProcessor.ts b/src/modules/atproto/infrastructure/services/FakeAtProtoOAuthProcessor.ts index 1b3d9780..16e909db 100644 --- a/src/modules/atproto/infrastructure/services/FakeAtProtoOAuthProcessor.ts +++ b/src/modules/atproto/infrastructure/services/FakeAtProtoOAuthProcessor.ts @@ -12,7 +12,7 @@ export class FakeAtProtoOAuthProcessor implements IOAuthProcessor { async generateAuthUrl(handle?: string): Promise> { try { // Generate tokens for the mock DID - const mockUrl = `http://localhost:3000/api/users/oauth/callback?code=mockCode&state=mockState&iss=mockIssuer`; + const mockUrl = `http://127.0.0.1:3000/api/users/oauth/callback?code=mockCode&state=mockState&iss=mockIssuer`; return ok(mockUrl); } catch (error: any) { return err(error); diff --git a/src/modules/user/infrastructure/http/controllers/CompleteOAuthSignInController.ts b/src/modules/user/infrastructure/http/controllers/CompleteOAuthSignInController.ts index f60ad916..faedb23f 100644 --- a/src/modules/user/infrastructure/http/controllers/CompleteOAuthSignInController.ts +++ b/src/modules/user/infrastructure/http/controllers/CompleteOAuthSignInController.ts @@ -16,6 +16,9 @@ export class CompleteOAuthSignInController extends Controller { const appUrl = configService.getAppConfig().appUrl; try { const { code, state, iss } = req.query; + console.log('OAuth callback received with params:', req.query); + console.log('request coming from:', req.headers.referer); + console.log('requesting host:', req.headers.host); if (!code || !state || !iss) { return this.badRequest(res, 'Missing required parameters'); @@ -34,6 +37,9 @@ export class CompleteOAuthSignInController extends Controller { ); } + console.log('setting cookies with tokens:', result.value); + console.log('redirecting to:', `${appUrl}/auth/complete`); + // Set tokens in httpOnly cookies this.cookieService.setTokens(res, { accessToken: result.value.accessToken, diff --git a/src/shared/infrastructure/config/EnvironmentConfigService.ts b/src/shared/infrastructure/config/EnvironmentConfigService.ts index 78f8e9a7..808343f6 100644 --- a/src/shared/infrastructure/config/EnvironmentConfigService.ts +++ b/src/shared/infrastructure/config/EnvironmentConfigService.ts @@ -88,7 +88,7 @@ export class EnvironmentConfigService { host: process.env.HOST || '127.0.0.1', }, app: { - appUrl: process.env.APP_URL || 'http://localhost:4000', + appUrl: process.env.APP_URL || 'http://127.0.0.1:4000', }, iframely: { apiKey: process.env.IFRAMELY_API_KEY || '', diff --git a/src/webapp/api-client/ApiClient.ts b/src/webapp/api-client/ApiClient.ts index fced1ff1..cb0abcfc 100644 --- a/src/webapp/api-client/ApiClient.ts +++ b/src/webapp/api-client/ApiClient.ts @@ -302,14 +302,14 @@ export * from './types'; // Factory functions for different client types export const createAuthenticatedApiClient = () => { return new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); }; export const createUnauthenticatedApiClient = () => { return new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', undefined, ); }; @@ -318,7 +318,7 @@ export const createUnauthenticatedApiClient = () => { export const createServerApiClient = async () => { const tokenManager = await createServerTokenManager(); return new ApiClient( - process.env.API_BASE_URL || 'http://localhost:3000', + process.env.API_BASE_URL || 'http://127.0.0.1:3000', tokenManager, ); }; diff --git a/src/webapp/app/(auth)/auth/complete/page.tsx b/src/webapp/app/(auth)/auth/complete/page.tsx index f192581f..b4bd3c96 100644 --- a/src/webapp/app/(auth)/auth/complete/page.tsx +++ b/src/webapp/app/(auth)/auth/complete/page.tsx @@ -18,7 +18,7 @@ function AuthCompleteContent() { const handleAuth = async () => { // Create API client instance const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/cards/layout.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/cards/layout.tsx index 9fad001f..299a1e0c 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/cards/layout.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/cards/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata({ params }: Props): Promise { const { handle } = await params; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/collections/layout.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/collections/layout.tsx index 2ac970c3..c636ad33 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/collections/layout.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/collections/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata({ params }: Props): Promise { const { handle } = await params; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/layout.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/layout.tsx index 58a2d37b..bad86610 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/layout.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/layout.tsx @@ -17,7 +17,7 @@ export async function generateMetadata({ params }: Props): Promise { const { handle } = await params; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx index 7ee43d95..bc013708 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withHeader)/opengraph-image.tsx @@ -17,7 +17,7 @@ export default async function Image(props: Props) { const { handle } = await props.params; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/layout.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/layout.tsx index 9af52647..91405495 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/layout.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/layout.tsx @@ -12,7 +12,7 @@ export async function generateMetadata({ params }: Props): Promise { const { rkey, handle } = await params; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx b/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx index af5e8250..4fe7d1eb 100644 --- a/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx +++ b/src/webapp/app/(dashboard)/profile/[handle]/(withoutHeader)/collections/[rkey]/opengraph-image.tsx @@ -17,7 +17,7 @@ export default async function Image(props: Props) { const { rkey, handle } = await props.params; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/components/AddToCollectionModal.tsx b/src/webapp/components/AddToCollectionModal.tsx index a3170717..9a375710 100644 --- a/src/webapp/components/AddToCollectionModal.tsx +++ b/src/webapp/components/AddToCollectionModal.tsx @@ -37,7 +37,7 @@ export function AddToCollectionModal({ // Create API client instance const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); @@ -50,7 +50,7 @@ export function AddToCollectionModal({ const fetchCard = useCallback(async () => { // Create API client instance const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); @@ -85,7 +85,7 @@ export function AddToCollectionModal({ try { // Create API client instance const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/components/extension/SaveCardPage.tsx b/src/webapp/components/extension/SaveCardPage.tsx index a93e2167..221423eb 100644 --- a/src/webapp/components/extension/SaveCardPage.tsx +++ b/src/webapp/components/extension/SaveCardPage.tsx @@ -24,7 +24,7 @@ export function SaveCardPage() { const apiClient = useMemo( () => new ApiClient( - process.env.PLASMO_PUBLIC_API_URL || 'http://localhost:3000', + process.env.PLASMO_PUBLIC_API_URL || 'http://127.0.0.1:3000', createExtensionTokenManager(), ), [], diff --git a/src/webapp/components/extension/SignInPage.tsx b/src/webapp/components/extension/SignInPage.tsx index 9c3a3381..3cf5da50 100644 --- a/src/webapp/components/extension/SignInPage.tsx +++ b/src/webapp/components/extension/SignInPage.tsx @@ -10,7 +10,7 @@ export function SignInPage() { const [loginError, setLoginError] = useState(''); const handleSignIn = () => { - const appUrl = process.env.PLASMO_PUBLIC_APP_URL || 'http://localhost:3000'; + const appUrl = process.env.PLASMO_PUBLIC_APP_URL || 'http://127.0.0.1:3000'; const loginUrl = `${appUrl}/login?extension-login=true`; chrome.tabs.create({ url: loginUrl }); window.close(); diff --git a/src/webapp/features/auth/components/loginForm/LoginForm.tsx b/src/webapp/features/auth/components/loginForm/LoginForm.tsx index 22b1f9ac..12fcf220 100644 --- a/src/webapp/features/auth/components/loginForm/LoginForm.tsx +++ b/src/webapp/features/auth/components/loginForm/LoginForm.tsx @@ -30,7 +30,7 @@ export default function LoginForm() { const isExtensionLogin = searchParams.get('extension-login') === 'true'; const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/mutations/useAddCard.tsx b/src/webapp/features/cards/lib/mutations/useAddCard.tsx index 31fdc5fc..c2de1365 100644 --- a/src/webapp/features/cards/lib/mutations/useAddCard.tsx +++ b/src/webapp/features/cards/lib/mutations/useAddCard.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useAddCard() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/mutations/useAddCardToLibrary.tsx b/src/webapp/features/cards/lib/mutations/useAddCardToLibrary.tsx index 6a31b070..27aff9c8 100644 --- a/src/webapp/features/cards/lib/mutations/useAddCardToLibrary.tsx +++ b/src/webapp/features/cards/lib/mutations/useAddCardToLibrary.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useAddCardToLibrary() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/mutations/useRemoveCardFromCollections.tsx b/src/webapp/features/cards/lib/mutations/useRemoveCardFromCollections.tsx index 4485bea7..1bab66da 100644 --- a/src/webapp/features/cards/lib/mutations/useRemoveCardFromCollections.tsx +++ b/src/webapp/features/cards/lib/mutations/useRemoveCardFromCollections.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useRemoveCardFromCollections() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/mutations/useRemoveCardFromLibrary.tsx b/src/webapp/features/cards/lib/mutations/useRemoveCardFromLibrary.tsx index cfdd526b..0321fdfa 100644 --- a/src/webapp/features/cards/lib/mutations/useRemoveCardFromLibrary.tsx +++ b/src/webapp/features/cards/lib/mutations/useRemoveCardFromLibrary.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useRemoveCardFromLibrary() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/queries/useCards.tsx b/src/webapp/features/cards/lib/queries/useCards.tsx index e4d47845..1406919b 100644 --- a/src/webapp/features/cards/lib/queries/useCards.tsx +++ b/src/webapp/features/cards/lib/queries/useCards.tsx @@ -9,7 +9,7 @@ interface Props { export default function useCards(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/queries/useGetCard.tsx b/src/webapp/features/cards/lib/queries/useGetCard.tsx index d6adbba4..53d22f90 100644 --- a/src/webapp/features/cards/lib/queries/useGetCard.tsx +++ b/src/webapp/features/cards/lib/queries/useGetCard.tsx @@ -8,7 +8,7 @@ interface Props { export default function useGetCard(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/queries/useGetCardFromMyLibrary.tsx b/src/webapp/features/cards/lib/queries/useGetCardFromMyLibrary.tsx index d614d9ac..6fd760bb 100644 --- a/src/webapp/features/cards/lib/queries/useGetCardFromMyLibrary.tsx +++ b/src/webapp/features/cards/lib/queries/useGetCardFromMyLibrary.tsx @@ -8,7 +8,7 @@ interface Props { export default function useGetCardFromMyLibrary(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/queries/useGetLibrariesForcard.tsx b/src/webapp/features/cards/lib/queries/useGetLibrariesForcard.tsx index 724297d1..160d2226 100644 --- a/src/webapp/features/cards/lib/queries/useGetLibrariesForcard.tsx +++ b/src/webapp/features/cards/lib/queries/useGetLibrariesForcard.tsx @@ -8,7 +8,7 @@ interface Props { export default function useGetLibrariesForCard(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/cards/lib/queries/useMyCards.tsx b/src/webapp/features/cards/lib/queries/useMyCards.tsx index 1f383ac0..2519879a 100644 --- a/src/webapp/features/cards/lib/queries/useMyCards.tsx +++ b/src/webapp/features/cards/lib/queries/useMyCards.tsx @@ -8,7 +8,7 @@ interface Props { export default function useMyCards(props?: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/mutations/useAddCardToCollection.tsx b/src/webapp/features/collections/lib/mutations/useAddCardToCollection.tsx index 3a9b0a0b..7f2dc58f 100644 --- a/src/webapp/features/collections/lib/mutations/useAddCardToCollection.tsx +++ b/src/webapp/features/collections/lib/mutations/useAddCardToCollection.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useAddCardToCollection() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/mutations/useCreateCollection.tsx b/src/webapp/features/collections/lib/mutations/useCreateCollection.tsx index 33278903..4e736bcd 100644 --- a/src/webapp/features/collections/lib/mutations/useCreateCollection.tsx +++ b/src/webapp/features/collections/lib/mutations/useCreateCollection.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useCreateCollection() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/mutations/useDeleteCollection.tsx b/src/webapp/features/collections/lib/mutations/useDeleteCollection.tsx index b58e6de7..d3d4e69e 100644 --- a/src/webapp/features/collections/lib/mutations/useDeleteCollection.tsx +++ b/src/webapp/features/collections/lib/mutations/useDeleteCollection.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useDeleteCollection() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/mutations/useUpdateCollection.tsx b/src/webapp/features/collections/lib/mutations/useUpdateCollection.tsx index c9c83c73..646c8e5d 100644 --- a/src/webapp/features/collections/lib/mutations/useUpdateCollection.tsx +++ b/src/webapp/features/collections/lib/mutations/useUpdateCollection.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useUpdateCollection() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/queries/useCollection.tsx b/src/webapp/features/collections/lib/queries/useCollection.tsx index 5e195611..21f21adf 100644 --- a/src/webapp/features/collections/lib/queries/useCollection.tsx +++ b/src/webapp/features/collections/lib/queries/useCollection.tsx @@ -10,7 +10,7 @@ interface Props { export default function useCollection(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/queries/useCollectionSearch.tsx b/src/webapp/features/collections/lib/queries/useCollectionSearch.tsx index 8b8b64ec..1d236062 100644 --- a/src/webapp/features/collections/lib/queries/useCollectionSearch.tsx +++ b/src/webapp/features/collections/lib/queries/useCollectionSearch.tsx @@ -11,7 +11,7 @@ interface Props { export default function useCollectionSearch(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/queries/useCollections.tsx b/src/webapp/features/collections/lib/queries/useCollections.tsx index 6e7b6b80..933d7420 100644 --- a/src/webapp/features/collections/lib/queries/useCollections.tsx +++ b/src/webapp/features/collections/lib/queries/useCollections.tsx @@ -9,7 +9,7 @@ interface Props { export default function useCollections(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/collections/lib/queries/useMyCollections.tsx b/src/webapp/features/collections/lib/queries/useMyCollections.tsx index aabec7fc..647d6bc3 100644 --- a/src/webapp/features/collections/lib/queries/useMyCollections.tsx +++ b/src/webapp/features/collections/lib/queries/useMyCollections.tsx @@ -8,7 +8,7 @@ interface Props { export default function useMyCollections(props?: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/feeds/lib/queries/useMyFeed.tsx b/src/webapp/features/feeds/lib/queries/useMyFeed.tsx index e69f2c69..f48eacac 100644 --- a/src/webapp/features/feeds/lib/queries/useMyFeed.tsx +++ b/src/webapp/features/feeds/lib/queries/useMyFeed.tsx @@ -8,7 +8,7 @@ interface Props { export default function useMyFeed(props?: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx b/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx index 5750f9db..6dd18f04 100644 --- a/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx +++ b/src/webapp/features/notes/lib/mutations/useUpdateNote.tsx @@ -4,7 +4,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; export default function useUpdateNote() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx b/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx index f032192f..4f4c83ba 100644 --- a/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx +++ b/src/webapp/features/profile/components/profileHeader/ProfileHeader.tsx @@ -22,7 +22,7 @@ interface Props { export default async function ProfileHeader(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/profile/lib/queries/useMyProfile.tsx b/src/webapp/features/profile/lib/queries/useMyProfile.tsx index b4138134..1276327b 100644 --- a/src/webapp/features/profile/lib/queries/useMyProfile.tsx +++ b/src/webapp/features/profile/lib/queries/useMyProfile.tsx @@ -4,7 +4,7 @@ import { useSuspenseQuery } from '@tanstack/react-query'; export default function useMyProfile() { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/features/profile/lib/queries/useProfile.tsx b/src/webapp/features/profile/lib/queries/useProfile.tsx index 7f061253..e564079e 100644 --- a/src/webapp/features/profile/lib/queries/useProfile.tsx +++ b/src/webapp/features/profile/lib/queries/useProfile.tsx @@ -8,7 +8,7 @@ interface Props { export default function useProfile(props: Props) { const apiClient = new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); diff --git a/src/webapp/hooks/useAuth.tsx b/src/webapp/hooks/useAuth.tsx index 55a70f5b..4c70ba62 100644 --- a/src/webapp/hooks/useAuth.tsx +++ b/src/webapp/hooks/useAuth.tsx @@ -43,7 +43,7 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => { // Create API client instance const createApiClient = useCallback(() => { return new ApiClient( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', createClientTokenManager(), ); }, []); diff --git a/src/webapp/hooks/useExtensionAuth.tsx b/src/webapp/hooks/useExtensionAuth.tsx index 25dd515f..a1b613da 100644 --- a/src/webapp/hooks/useExtensionAuth.tsx +++ b/src/webapp/hooks/useExtensionAuth.tsx @@ -36,7 +36,7 @@ export const ExtensionAuthProvider = ({ const createApiClient = useCallback((token: string | null) => { return new ApiClient( - process.env.PLASMO_PUBLIC_API_URL || 'http://localhost:3000', + process.env.PLASMO_PUBLIC_API_URL || 'http://127.0.0.1:3000', createExtensionTokenManager(), ); }, []); diff --git a/src/webapp/services/auth.ts b/src/webapp/services/auth.ts index 3143b569..c39ea109 100644 --- a/src/webapp/services/auth.ts +++ b/src/webapp/services/auth.ts @@ -59,7 +59,7 @@ export const clearAuth = (): void => { export const createClientTokenManager = () => { const storage = new ClientTokenStorage(); const refresher = new ApiTokenRefresher( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', ); return new TokenManager(storage, refresher); }; @@ -76,7 +76,7 @@ export const createServerTokenManager = async () => { export const createExtensionTokenManager = () => { const storage = new ClientTokenStorage(); const refresher = new ApiTokenRefresher( - process.env.NEXT_PUBLIC_API_BASE_URL || 'http://localhost:3000', + process.env.NEXT_PUBLIC_API_BASE_URL || 'http://127.0.0.1:3000', ); return new TokenManager(storage, refresher); };