File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_CONT
1919NEXTAUTH_SECRET = " secret"
2020NEXTAUTH_URL = " http://localhost:3000"
2121
22+ # The default /home page is a blog page that may not be suitable for your use case.
23+ # You can change it to /balances or any other URL you want.
24+ # Note that it creates a permanent redirect, so changing it later will require a cache clear from users.
25+ DEFAULT_HOMEPAGE = " /home"
26+
2227# If provided, server-side calls will use this instead of NEXTAUTH_URL.
2328# Useful in environments when the server doesn't have access to the canonical URL
2429# of your site.
Original file line number Diff line number Diff line change 55 * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
66 * for Docker builds.
77 */
8- await import ( './src/env.js' ) ;
9-
10- /** @type {import("next").NextConfig } */
11-
128import pwa from 'next-pwa' ;
139// @ts -ignore
1410import nextra from 'nextra' ;
@@ -19,6 +15,7 @@ const withPwa = pwa({
1915 // disable: process.env.NODE_ENV === 'development',
2016} ) ;
2117
18+ /** @type {import("next").NextConfig } */
2219const config = {
2320 reactStrictMode : true ,
2421 output : process . env . DOCKER_OUTPUT ? 'standalone' : undefined ,
@@ -35,6 +32,13 @@ const config = {
3532 defaultLocale : 'en' ,
3633 } ,
3734 transpilePackages : [ 'geist' ] ,
35+ redirects : async ( ) => [
36+ {
37+ source : '/' ,
38+ destination : process . env . DEFAULT_HOMEPAGE ?? '/home' ,
39+ permanent : true ,
40+ } ,
41+ ] ,
3842 images : {
3943 remotePatterns : [
4044 {
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export const env = createEnv({
4949 WEB_PUSH_PUBLIC_KEY : z . string ( ) . optional ( ) ,
5050 FEEDBACK_EMAIL : z . string ( ) . optional ( ) ,
5151 DISCORD_WEBHOOK_URL : z . string ( ) . optional ( ) ,
52+ DEFAULT_HOMEPAGE : z . string ( ) . default ( '/home' ) ,
5253 } ,
5354
5455 /**
@@ -92,6 +93,7 @@ export const env = createEnv({
9293 WEB_PUSH_PUBLIC_KEY : process . env . WEB_PUSH_PUBLIC_KEY ,
9394 FEEDBACK_EMAIL : process . env . FEEDBACK_EMAIL ,
9495 DISCORD_WEBHOOK_URL : process . env . DISCORD_WEBHOOK_URL ,
96+ DEFAULT_HOMEPAGE : process . env . DEFAULT_HOMEPAGE ,
9597 } ,
9698 /**
9799 * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
Original file line number Diff line number Diff line change @@ -223,7 +223,8 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
223223 if ( session ) {
224224 return {
225225 redirect : {
226- destination : callbackUrl && ! Array . isArray ( callbackUrl ) ? callbackUrl : '/balances' ,
226+ destination :
227+ callbackUrl && ! Array . isArray ( callbackUrl ) ? callbackUrl : env . DEFAULT_HOMEPAGE ,
227228 permanent : false ,
228229 } ,
229230 } ;
Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ export default function Home() {
2121 return (
2222 < >
2323 < Head >
24- < title > SplitPro: Split Expenses with your friends for free</ title >
25- < meta name = "description" content = "SplitPro: Split Expenses with your friends for free" />
26- < link rel = "icon" href = "/favicon.ico" />
2724 { process . env . NODE_ENV === 'production' && (
2825 < >
2926 < script async defer src = "https://scripts.simpleanalyticscdn.com/latest.js" > </ script >
You can’t perform that action at this time.
0 commit comments