diff --git a/packages/api/src/routers/auth/apple_auth.ts b/packages/api/src/routers/auth/apple_auth.ts
index e9dfaf0b3..00ea80704 100644
--- a/packages/api/src/routers/auth/apple_auth.ts
+++ b/packages/api/src/routers/auth/apple_auth.ts
@@ -16,6 +16,7 @@ import {
createWebAuthToken,
suggestedUsername,
} from './jwt_helpers'
+import { DEFAULT_HOME_PATH } from '../../utils/navigation'
const appleBaseURL = 'https://appleid.apple.com'
const audienceName = 'app.omnivore.app'
@@ -142,10 +143,13 @@ export async function handleAppleWebAuth(
const authToken = await createWebAuthToken(userId)
if (authToken) {
- const ssoToken = createSsoToken(authToken, `${baseURL()}/home`)
+ const ssoToken = createSsoToken(
+ authToken,
+ `${baseURL()}${DEFAULT_HOME_PATH}`
+ )
const redirectURL = isVercel
? ssoRedirectURL(ssoToken)
- : `${baseURL()}/home`
+ : `${baseURL()}${DEFAULT_HOME_PATH}`
analytics.capture({
distinctId: user.id,
diff --git a/packages/api/src/routers/auth/auth_router.ts b/packages/api/src/routers/auth/auth_router.ts
index 1bf9828da..7cb940e78 100644
--- a/packages/api/src/routers/auth/auth_router.ts
+++ b/packages/api/src/routers/auth/auth_router.ts
@@ -48,6 +48,7 @@ import {
} from './google_auth'
import { createWebAuthToken } from './jwt_helpers'
import { createMobileAccountCreationResponse } from './mobile/account_creation'
+import { DEFAULT_HOME_PATH } from '../../utils/navigation'
export interface SignupRequest {
email: string
@@ -373,11 +374,13 @@ export function authRouter() {
decodeURIComponent(redirectUri)
)
} else {
- redirectUri = `${env.client.url}/home`
+ redirectUri = `${env.client.url}${DEFAULT_HOME_PATH}`
}
}
- redirectUri = redirectUri ? redirectUri : `${env.client.url}/home`
+ redirectUri = redirectUri
+ ? redirectUri
+ : `${env.client.url}${DEFAULT_HOME_PATH}`
const message = res.get('Message')
if (message) {
diff --git a/packages/api/src/routers/auth/google_auth.ts b/packages/api/src/routers/auth/google_auth.ts
index 1108b6f23..21fcafba1 100644
--- a/packages/api/src/routers/auth/google_auth.ts
+++ b/packages/api/src/routers/auth/google_auth.ts
@@ -9,6 +9,7 @@ import { logger } from '../../utils/logger'
import { createSsoToken, ssoRedirectURL } from '../../utils/sso'
import { DecodeTokenResult } from './auth_types'
import { createPendingUserToken, createWebAuthToken } from './jwt_helpers'
+import { DEFAULT_HOME_PATH } from '../../utils/navigation'
export const googleAuthMobile = (): OAuth2Client =>
new google.auth.OAuth2(env.google.auth.clientId, env.google.auth.secret)
@@ -159,10 +160,13 @@ export async function handleGoogleWebAuth(
const authToken = await createWebAuthToken(userId)
if (authToken) {
- const ssoToken = createSsoToken(authToken, `${baseURL()}/home`)
+ const ssoToken = createSsoToken(
+ authToken,
+ `${baseURL()}${DEFAULT_HOME_PATH}`
+ )
const redirectURL = isVercel
? ssoRedirectURL(ssoToken)
- : `${baseURL()}/home`
+ : `${baseURL()}${DEFAULT_HOME_PATH}`
return {
authToken,
diff --git a/packages/api/src/utils/navigation.ts b/packages/api/src/utils/navigation.ts
new file mode 100644
index 000000000..97d275d17
--- /dev/null
+++ b/packages/api/src/utils/navigation.ts
@@ -0,0 +1 @@
+export const DEFAULT_HOME_PATH = `/l/home`
diff --git a/packages/web/components/elements/images/OmnivoreLogoBase.tsx b/packages/web/components/elements/images/OmnivoreLogoBase.tsx
index 605e7c632..7358001f7 100644
--- a/packages/web/components/elements/images/OmnivoreLogoBase.tsx
+++ b/packages/web/components/elements/images/OmnivoreLogoBase.tsx
@@ -1,5 +1,6 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
+import { DEFAULT_HOME_PATH } from '../../../lib/navigations'
export type OmnivoreLogoBaseProps = {
color?: string
href?: string
@@ -28,9 +29,9 @@ export function OmnivoreLogoBase(props: OmnivoreLogoBaseProps): JSX.Element {
}
const query = window.sessionStorage.getItem('q')
if (query) {
- window.location.assign(`/l/home?${query}`)
+ window.location.assign(`${DEFAULT_HOME_PATH}?${query}`)
} else {
- window.location.replace(`/l/home`)
+ window.location.replace(DEFAULT_HOME_PATH)
}
}}
tabIndex={-1}
diff --git a/packages/web/components/templates/SettingsLayout.tsx b/packages/web/components/templates/SettingsLayout.tsx
index f1eb850cf..800996992 100644
--- a/packages/web/components/templates/SettingsLayout.tsx
+++ b/packages/web/components/templates/SettingsLayout.tsx
@@ -14,6 +14,7 @@ import { SettingsDropdown } from './navMenu/SettingsDropdown'
import { useVerifyAuth } from '../../lib/hooks/useVerifyAuth'
import Link from 'next/link'
import { CaretLeft } from '@phosphor-icons/react'
+import { DEFAULT_HOME_PATH } from '../../lib/navigations'
type SettingsLayoutProps = {
title?: string
@@ -32,7 +33,7 @@ const ReturnButton = (): JSX.Element => {
},
}}
>
-
+
{
router.push(navReturn)
return
}
- router?.push('/l/home')
+ router?.push(DEFAULT_HOME_PATH)
},
},
{
diff --git a/packages/web/pages/api/client/auth.ts b/packages/web/pages/api/client/auth.ts
index e63d81767..06694c79a 100644
--- a/packages/web/pages/api/client/auth.ts
+++ b/packages/web/pages/api/client/auth.ts
@@ -3,6 +3,7 @@ import { serialize } from 'cookie'
import * as jwt from 'jsonwebtoken'
import { withSentry } from '@sentry/nextjs'
import { ssoJwtSecret } from '../../../lib/appConfig'
+import { DEFAULT_HOME_PATH } from '../../../lib/navigations'
type AuthPayload = {
authToken: string
@@ -29,7 +30,7 @@ const requestHandler = (req: NextApiRequest, res: NextApiResponse): void => {
})
} else {
res.writeHead(302, {
- Location: '/l/home',
+ Location: DEFAULT_HOME_PATH,
})
}
diff --git a/packages/web/pages/index.tsx b/packages/web/pages/index.tsx
index 51b2b3b14..da6313fbd 100644
--- a/packages/web/pages/index.tsx
+++ b/packages/web/pages/index.tsx
@@ -3,6 +3,7 @@ import { useRouter } from 'next/router'
import { PageMetaData } from '../components/patterns/PageMetaData'
import { LoadingView } from '../components/patterns/LoadingView'
import { About } from '../components/templates/About'
+import { DEFAULT_HOME_PATH } from '../lib/navigations'
export default function LandingPage(): JSX.Element {
const router = useRouter()
@@ -13,7 +14,7 @@ export default function LandingPage(): JSX.Element {
if (navReturn) {
router.push(navReturn)
} else {
- router.push('/l/home')
+ router.push(DEFAULT_HOME_PATH)
}
return <>>
} else if (isLoading || !router.isReady) {
diff --git a/packages/web/pages/tools/bulk.tsx b/packages/web/pages/tools/bulk.tsx
index f1142d20b..76e55bb8d 100644
--- a/packages/web/pages/tools/bulk.tsx
+++ b/packages/web/pages/tools/bulk.tsx
@@ -19,6 +19,7 @@ import {
BorderedFormInput,
FormLabel,
} from '../../components/elements/FormElements'
+import { DEFAULT_HOME_PATH } from '../../lib/navigations'
type RunningState = 'none' | 'confirming' | 'running' | 'completed'
@@ -202,7 +203,7 @@ export default function BulkPerformer(): JSX.Element {