Update 'next' package version and refactor user account handling
This commit updates the 'next' package from version 14.2.0 to 14.2.1 across various modules. It also refactors the code for user account handling to make it controlled by an enableTeamAccounts flag in the featureFlagsConfig, essentially allowing the enabling or disabling of the 'team accounts' feature according to the specified flag.
This commit is contained in:
@@ -2,12 +2,14 @@ import { cache } from 'react';
|
||||
|
||||
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
|
||||
|
||||
import featureFlagsConfig from '~/config/feature-flags.config';
|
||||
import { Database } from '~/lib/database.types';
|
||||
|
||||
export const loadUserWorkspace = cache(async () => {
|
||||
const client = getSupabaseServerComponentClient();
|
||||
const loadAccounts = featureFlagsConfig.enableTeamAccounts;
|
||||
|
||||
const accounts = await loadUserAccounts(client);
|
||||
const accounts = loadAccounts ? await loadUserAccounts(client) : [];
|
||||
const { data } = await client.auth.getSession();
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user