Remove path environment variables
Paths such as SIGN_IN_PATH and SIGN_UP_PATH have been hardcoded into the application instead of being environment variables. These changes simplify the configuration of the application, making maintenance and understanding of the codebase easier.
This commit is contained in:
@@ -619,12 +619,6 @@ NEXT_PUBLIC_KEYSTATIC_CONTENT_PATH=./content
|
||||
# LOCALES PATH
|
||||
NEXT_PUBLIC_LOCALES_PATH=apps/web/public/locales
|
||||
|
||||
# PATHS (to be used in "packages")
|
||||
SIGN_IN_PATH=/auth/sign-in
|
||||
SIGN_UP_PATH=/auth/sign-up
|
||||
TEAM_ACCOUNTS_HOME_PATH=/home
|
||||
INVITATION_PAGE_PATH=/join
|
||||
|
||||
# FEATURE FLAGS
|
||||
NEXT_PUBLIC_ENABLE_THEME_TOGGLE=true
|
||||
NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_DELETION=true
|
||||
|
||||
@@ -30,12 +30,6 @@ NEXT_PUBLIC_KEYSTATIC_CONTENT_PATH=./content
|
||||
# LOCALES PATH
|
||||
NEXT_PUBLIC_LOCALES_PATH=apps/web/public/locales
|
||||
|
||||
# PATHS (to be used in "packages")
|
||||
SIGN_IN_PATH=/auth/sign-in
|
||||
SIGN_UP_PATH=/auth/sign-up
|
||||
TEAM_ACCOUNTS_HOME_PATH=/home
|
||||
INVITATION_PAGE_PATH=/join
|
||||
|
||||
# FEATURE FLAGS
|
||||
NEXT_PUBLIC_ENABLE_THEME_TOGGLE=true
|
||||
NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_DELETION=true
|
||||
|
||||
@@ -2,21 +2,12 @@
|
||||
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
import { enhanceAction } from '@kit/next/actions';
|
||||
import { getSupabaseServerActionClient } from '@kit/supabase/server-actions-client';
|
||||
|
||||
import { CreateTeamSchema } from '../../schema/create-team.schema';
|
||||
import { createCreateTeamAccountService } from '../services/create-team-account.service';
|
||||
|
||||
const path = z
|
||||
.string({
|
||||
required_error: 'variable TEAM_ACCOUNTS_HOME_PATH is required',
|
||||
})
|
||||
.min(1)
|
||||
.parse(process.env.TEAM_ACCOUNTS_HOME_PATH);
|
||||
|
||||
export const createOrganizationAccountAction = enhanceAction(
|
||||
async (params, user) => {
|
||||
const client = getSupabaseServerActionClient();
|
||||
@@ -31,7 +22,7 @@ export const createOrganizationAccountAction = enhanceAction(
|
||||
throw new Error('Error creating team account');
|
||||
}
|
||||
|
||||
const accountHomePath = path + '/' + data.slug;
|
||||
const accountHomePath = '/home/' + data.slug;
|
||||
|
||||
redirect(accountHomePath);
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Database } from '@kit/supabase/database';
|
||||
|
||||
type Invitation = Database['public']['Tables']['invitations']['Row'];
|
||||
|
||||
const invitePath = process.env.INVITATION_PAGE_PATH;
|
||||
const invitePath = '/join';
|
||||
const siteURL = process.env.NEXT_PUBLIC_SITE_URL;
|
||||
const productName = process.env.NEXT_PUBLIC_PRODUCT_NAME ?? '';
|
||||
const emailSender = process.env.EMAIL_SENDER;
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
import type { SupabaseClient, User } from '@supabase/supabase-js';
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
import { checkRequiresMultiFactorAuthentication } from './check-requires-mfa';
|
||||
|
||||
const MULTI_FACTOR_AUTH_VERIFY_PATH = z
|
||||
.string()
|
||||
.default('/auth/verify')
|
||||
.parse(process.env.MULTI_FACTOR_AUTH_VERIFY_PATH);
|
||||
|
||||
const SIGN_IN_PATH = z
|
||||
.string()
|
||||
.default('/auth/sign-in')
|
||||
.parse(process.env.SIGN_IN_PATH);
|
||||
const MULTI_FACTOR_AUTH_VERIFY_PATH = '/auth/verify';
|
||||
const SIGN_IN_PATH = '/auth/sign-in';
|
||||
|
||||
/**
|
||||
* @name requireUser
|
||||
|
||||
@@ -67,10 +67,6 @@
|
||||
"EMAIL_HOST",
|
||||
"EMAIL_TLS",
|
||||
"EMAIL_USER",
|
||||
"EMAIL_PASSWORD",
|
||||
"SIGN_IN_PATH",
|
||||
"SIGN_UP_PATH",
|
||||
"TEAM_ACCOUNTS_HOME_PATH",
|
||||
"INVITATION_PAGE_PATH"
|
||||
"EMAIL_PASSWORD"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user