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:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user