mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(console): fix guide string generator (#2702)
This commit is contained in:
parent
ae8ac70a43
commit
9247ed4c1c
4 changed files with 8 additions and 8 deletions
|
@ -3,7 +3,7 @@ import Step from '@mdx/components/Step';
|
|||
import Tabs from '@mdx/components/Tabs';
|
||||
import TabItem from '@mdx/components/TabItem';
|
||||
import Alert from '@/components/Alert';
|
||||
import { generateRandomString } from '@logto/core-kit';
|
||||
import { buildIdGenerator } from '@logto/core-kit';
|
||||
|
||||
<Step
|
||||
title="Add dependencies"
|
||||
|
@ -83,7 +83,7 @@ The SDK requires [express-session](https://www.npmjs.com/package/express-session
|
|||
import session from 'express-session';
|
||||
|
||||
app.use(cookieParser());
|
||||
app.use(session({ secret: '${generateRandomString(32)}', cookie: { maxAge: 14 * 24 * 60 * 60 } }));`}
|
||||
app.use(session({ secret: '${buildIdGenerator(32)()}', cookie: { maxAge: 14 * 24 * 60 * 60 } }));`}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import Step from '@mdx/components/Step';
|
|||
import Tabs from '@mdx/components/Tabs';
|
||||
import TabItem from '@mdx/components/TabItem';
|
||||
import Alert from '@/components/Alert';
|
||||
import { generateRandomString } from '@logto/core-kit';
|
||||
import { buildIdGenerator } from '@logto/core-kit';
|
||||
|
||||
<Step
|
||||
title="添加依赖"
|
||||
|
@ -83,7 +83,7 @@ export const logtoClient = new LogtoClient({
|
|||
import session from 'express-session';
|
||||
|
||||
app.use(cookieParser());
|
||||
app.use(session({ secret: '${generateRandomString(32)}', cookie: { maxAge: 14 * 24 * 60 * 60 } }));`}
|
||||
app.use(session({ secret: '${buildIdGenerator(32)()}', cookie: { maxAge: 14 * 24 * 60 * 60 } }));`}
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import Step from '@mdx/components/Step';
|
|||
import Tabs from '@mdx/components/Tabs';
|
||||
import TabItem from '@mdx/components/TabItem';
|
||||
import Alert from '@/components/Alert';
|
||||
import { generateRandomString } from '@logto/core-kit';
|
||||
import { buildIdGenerator } from '@logto/core-kit';
|
||||
|
||||
<Step
|
||||
title="Add Logto SDK as a dependency"
|
||||
|
@ -61,7 +61,7 @@ export const logtoClient = new LogtoClient({
|
|||
appId: '${props.appId}',
|
||||
appSecret: '${props.appSecret}',
|
||||
baseUrl: 'http://localhost:3000', // Change to your own base URL
|
||||
cookieSecret: '${generateRandomString(32)}', // Auto-generated 32 digit secret
|
||||
cookieSecret: '${buildIdGenerator(32)()}', // Auto-generated 32 digit secret
|
||||
cookieSecure: process.env.NODE_ENV === 'production',
|
||||
});`}
|
||||
</code>
|
||||
|
|
|
@ -3,7 +3,7 @@ import Step from '@mdx/components/Step';
|
|||
import Tabs from '@mdx/components/Tabs';
|
||||
import TabItem from '@mdx/components/TabItem';
|
||||
import Alert from '@/components/Alert';
|
||||
import { generateRandomString } from '@logto/core-kit';
|
||||
import { buildIdGenerator } from '@logto/core-kit';
|
||||
|
||||
<Step
|
||||
title="将 Logto SDK 添加至依赖"
|
||||
|
@ -61,7 +61,7 @@ export const logtoClient = new LogtoClient({
|
|||
appId: '${props.appId}',
|
||||
appSecret: '${props.appSecret}',
|
||||
baseUrl: 'http://localhost:3000', // 你可以修改为自己真实的 URL
|
||||
cookieSecret: '${generateRandomString(32)}', // Logto 自动帮你生成的 32 位密钥
|
||||
cookieSecret: '${buildIdGenerator(32)()}', // Logto 自动帮你生成的 32 位密钥
|
||||
cookieSecure: process.env.NODE_ENV === 'production',
|
||||
});`}
|
||||
</code>
|
||||
|
|
Loading…
Reference in a new issue