feat: add routes configuration in website settings for default login redirect

This commit is contained in:
javayhu 2025-04-24 23:00:37 +08:00
parent 9046645006
commit b16a1918de
3 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { PaymentTypes, PlanIntervals } from '@/payment/types';
import { Routes } from '@/routes';
import type { WebsiteConfig } from '@/types';
/**
@ -29,6 +30,9 @@ export const websiteConfig: WebsiteConfig = {
youtube: 'https://www.youtube.com/@MkSaaS',
},
},
routes: {
defaultLoginRedirect: Routes.Dashboard,
},
analytics: {
enableVercelAnalytics: false,
enableSpeedInsights: false,

View File

@ -1,3 +1,5 @@
import { websiteConfig } from './config/website';
/**
* The routes for the application
*/
@ -79,4 +81,4 @@ export const protectedRoutes = [
/**
* The default redirect path after logging in
*/
export const DEFAULT_LOGIN_REDIRECT = Routes.Dashboard;
export const DEFAULT_LOGIN_REDIRECT = websiteConfig.routes.defaultLoginRedirect;

View File

@ -5,6 +5,7 @@ import type { ReactNode } from 'react';
*/
export type WebsiteConfig = {
metadata: MetadataConfig;
routes: RoutesConfig;
analytics: AnalyticsConfig;
auth: AuthConfig;
i18n: I18nConfig;
@ -57,6 +58,13 @@ export interface SocialConfig {
tiktok?: string;
}
/**
* Routes configuration
*/
export interface RoutesConfig {
defaultLoginRedirect?: string; // The default login redirect route
}
/**
* Analytics configuration
*/