File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ import {
18
18
mainSiteUrl ,
19
19
} from './docusaurus-common.config' ;
20
20
import ogImageGenerator from './plugins/og-image-generator' ;
21
+ import tutorialGenerator from './plugins/tutorial-generator' ;
22
+ import { yes } from '@silverhand/essentials' ;
21
23
22
24
const getLogtoDocsUrl = ( ) =>
23
25
isCfPagesPreview
@@ -52,6 +54,7 @@ const config: Config = {
52
54
customFields : {
53
55
inkeepApiKey : process . env . INKEEP_API_KEY ,
54
56
logtoApiBaseUrl : process . env . LOGTO_API_BASE_URL ,
57
+ isDevFeatureEnabled : yes ( process . env . IS_DEV_FEATURE_ENABLED ) ,
55
58
} ,
56
59
57
60
staticDirectories : [ 'static' , 'static-localized/' + currentLocale ] ,
Original file line number Diff line number Diff line change @@ -29,15 +29,21 @@ const CACHE_EXPIRY_KEY = '_logto_google_one_tap_config_expiry';
29
29
const CACHE_EXPIRY_TIME = 1 * 60 * 60 * 1000 ; // 1 hour
30
30
31
31
// Default API base URL
32
- const DEFAULT_API_BASE_URL = 'https://auth.logto.io' ;
32
+ const DEFAULT_API_BASE_PROD_URL = 'https://auth.logto.io' ;
33
+ const DEFAULT_API_BASE_DEV_URL = 'https://auth.logto.dev' ;
33
34
34
35
export default function LayoutWrapper ( props : Props ) : ReactNode {
35
36
const [ config , setConfig ] = useState < GoogleOneTapConfig | undefined > ( undefined ) ;
36
37
const { siteConfig } = useDocusaurusContext ( ) ;
37
38
38
39
// Get the API base URL from customFields, or use the default value if it doesn't exist
39
40
const logtoApiBaseUrl = siteConfig . customFields ?. logtoApiBaseUrl ;
40
- const apiBaseUrl = typeof logtoApiBaseUrl === 'string' ? logtoApiBaseUrl : DEFAULT_API_BASE_URL ;
41
+ const apiBaseUrl =
42
+ typeof logtoApiBaseUrl === 'string'
43
+ ? logtoApiBaseUrl
44
+ : siteConfig . customFields ?. isDevFeatureEnabled
45
+ ? DEFAULT_API_BASE_DEV_URL
46
+ : DEFAULT_API_BASE_PROD_URL ;
41
47
42
48
useEffect ( ( ) => {
43
49
const fetchConfig = async ( ) => {
You can’t perform that action at this time.
0 commit comments