Skip to content

Commit 64778e6

Browse files
chore: update translations and generated content (#1159)
Co-authored-by: charIeszhao <[email protected]>
1 parent 28becc0 commit 64778e6

File tree

8 files changed

+124
-68
lines changed
  • i18n
    • de/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • es/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • fr/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • ja/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • ko/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • pt-BR/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • zh-CN/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router
    • zh-TW/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router

8 files changed

+124
-68
lines changed

โ€Ži18n/de/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router/_integration.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ import { LogtoNextConfig } from '@logto/next';
1515
export const logtoConfig: LogtoNextConfig = {
1616
appId: '<your-application-id>',
1717
appSecret: '<your-app-secret-copied-from-console>',
18-
endpoint: '<your-logto-endpoint>', // Z.B. http://localhost:3001
19-
baseUrl: '<your-nextjs-app-base-url>', // Z.B. http://localhost:3000
18+
endpoint: '<your-logto-endpoint>', // Z. B. http://localhost:3001
19+
baseUrl: '<your-nextjs-app-base-url>', // Z. B. http://localhost:3000
2020
cookieSecret: 'complex_password_at_least_32_characters_long',
2121
cookieSecure: process.env.NODE_ENV === 'production',
2222
};
2323
```
2424

25+
**Hinweis:**
26+
Wenn du eine Umgebungsvariable fรผr `cookieSecret` verwendest (z. B. `process.env.LOGTO_COOKIE_SECRET`), stelle sicher, dass der Wert mindestens 32 Zeichen lang ist. Wenn diese Anforderung nicht erfรผllt ist, wirft Logto wรคhrend des Builds oder zur Laufzeit folgenden Fehler:
27+
28+
`TypeError: Either sessionWrapper or encryptionKey must be provided for CookieStorage`
29+
30+
Um diesen Fehler zu vermeiden, stelle sicher, dass die Umgebungsvariable korrekt gesetzt ist oder gib einen Fallback-Wert mit einer Mindestlรคnge von 32 Zeichen an.
31+
2532
### Redirect-URIs konfigurieren \{#configure-redirect-uris}
2633

2734
<SignInFlowSummary />
@@ -32,9 +39,9 @@ export const logtoConfig: LogtoNextConfig = {
3239

3340
### Callback behandeln \{#handle-callback}
3441

35-
Nachdem sich der Benutzer angemeldet hat, wird Logto den Benutzer zurรผck zur oben konfigurierten Redirect-URI weiterleiten. Es gibt jedoch noch Dinge zu tun, damit deine Anwendung ordnungsgemรครŸ funktioniert.
42+
Nachdem sich der Benutzer angemeldet hat, leitet Logto den Benutzer zurรผck zur oben konfigurierten Redirect-URI. Es gibt jedoch noch Dinge zu tun, damit deine Anwendung richtig funktioniert.
3643

37-
Wir bieten eine Hilfsfunktion `handleSignIn`, um den Anmelde-Callback zu behandeln:
44+
Wir stellen eine Hilfsfunktion `handleSignIn` bereit, um den Sign-In-Callback zu behandeln:
3845

3946
```tsx title="app/callback/route.ts"
4047
import { handleSignIn } from '@logto/next/server-actions';
@@ -50,9 +57,9 @@ export async function GET(request: NextRequest) {
5057
}
5158
```
5259

53-
### Anmeldung und Abmeldung implementieren \{#implement-sign-in-and-sign-out}
60+
### Sign-In und Sign-Out implementieren \{#implement-sign-in-and-sign-out}
5461

55-
#### Anmelde- und Abmeldebutton implementieren \{#implement-sign-in-and-sign-out-button}
62+
#### Sign-In- und Sign-Out-Button implementieren \{#implement-sign-in-and-sign-out-button}
5663

5764
Im Next.js App Router werden Ereignisse in Client-Komponenten behandelt, daher mรผssen wir zuerst zwei Komponenten erstellen: `SignIn` und `SignOut`.
5865

@@ -70,7 +77,7 @@ const SignIn = ({ onSignIn }: Props) => {
7077
onSignIn();
7178
}}
7279
>
73-
Anmelden
80+
Sign In
7481
</button>
7582
);
7683
};
@@ -92,21 +99,21 @@ const SignOut = ({ onSignOut }: Props) => {
9299
onSignOut();
93100
}}
94101
>
95-
Abmelden
102+
Sign Out
96103
</button>
97104
);
98105
};
99106

100107
export default SignOut;
101108
```
102109

103-
Denke daran, `'use client'` oben in die Datei hinzuzufรผgen, um anzuzeigen, dass diese Komponenten Client-Komponenten sind.
110+
Denke daran, `'use client'` am Anfang der Datei hinzuzufรผgen, um anzugeben, dass diese Komponenten Client-Komponenten sind.
104111

105112
#### Buttons zur Startseite hinzufรผgen \{#add-buttons-to-home-page}
106113

107114
<ServerActionsTip />
108115

109-
Fรผgen wir nun die Anmelde- und Abmeldebuttons auf deiner Startseite hinzu. Wir mรผssen die Serveraktionen im SDK bei Bedarf aufrufen. Um dabei zu helfen, verwende `getLogtoContext`, um den Authentifizierungsstatus abzurufen.
116+
Fรผgen wir nun die Sign-In- und Sign-Out-Buttons auf deiner Startseite hinzu. Wir mรผssen die Serveraktionen im SDK bei Bedarf aufrufen. Um dabei zu helfen, verwende `getLogtoContext`, um den Authentifizierungsstatus abzurufen.
110117

111118
```tsx title="app/page.tsx"
112119
import { getLogtoContext, signIn, signOut } from '@logto/next/server-actions';

โ€Ži18n/es/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router/_integration.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ import { LogtoNextConfig } from '@logto/next';
1515
export const logtoConfig: LogtoNextConfig = {
1616
appId: '<your-application-id>',
1717
appSecret: '<your-app-secret-copied-from-console>',
18-
endpoint: '<your-logto-endpoint>', // Ej. http://localhost:3001
19-
baseUrl: '<your-nextjs-app-base-url>', // Ej. http://localhost:3000
18+
endpoint: '<your-logto-endpoint>', // Ejemplo: http://localhost:3001
19+
baseUrl: '<your-nextjs-app-base-url>', // Ejemplo: http://localhost:3000
2020
cookieSecret: 'complex_password_at_least_32_characters_long',
2121
cookieSecure: process.env.NODE_ENV === 'production',
2222
};
2323
```
2424

25+
**Nota:**
26+
Si utilizas una variable de entorno para `cookieSecret` (por ejemplo, `process.env.LOGTO_COOKIE_SECRET`), asegรบrate de que el valor tenga al menos 32 caracteres. Si no se cumple este requisito, Logto lanzarรก el siguiente error durante la compilaciรณn o en tiempo de ejecuciรณn:
27+
28+
`TypeError: Either sessionWrapper or encryptionKey must be provided for CookieStorage`
29+
30+
Para evitar este error, asegรบrate de que la variable de entorno estรฉ correctamente configurada o proporciona un valor alternativo con una longitud mรญnima de 32 caracteres.
31+
2532
### Configurar URIs de redirecciรณn \{#configure-redirect-uris}
2633

2734
<SignInFlowSummary />
@@ -30,9 +37,9 @@ export const logtoConfig: LogtoNextConfig = {
3037

3138
<WebConfigureRedirectUris />
3239

33-
### Manejar callback \{#handle-callback}
40+
### Manejar el callback \{#handle-callback}
3441

35-
Despuรฉs de que el usuario inicie sesiรณn, Logto redirigirรก al usuario de vuelta a la URI de redirecciรณn configurada anteriormente. Sin embargo, aรบn hay cosas que hacer para que tu aplicaciรณn funcione correctamente.
42+
Despuรฉs de que el usuario inicie sesiรณn, Logto redirigirรก al usuario de vuelta al URI de redirecciรณn configurado anteriormente. Sin embargo, aรบn hay cosas que hacer para que tu aplicaciรณn funcione correctamente.
3643

3744
Proporcionamos una funciรณn auxiliar `handleSignIn` para manejar el callback de inicio de sesiรณn:
3845

@@ -54,7 +61,7 @@ export async function GET(request: NextRequest) {
5461

5562
#### Implementar botรณn de inicio y cierre de sesiรณn \{#implement-sign-in-and-sign-out-button}
5663

57-
En Next.js App Router, los eventos se manejan en componentes del cliente, por lo que primero necesitamos crear dos componentes: `SignIn` y `SignOut`.
64+
En Next.js App Router, los eventos se manejan en componentes cliente, asรญ que primero necesitamos crear dos componentes: `SignIn` y `SignOut`.
5865

5966
```tsx title="app/sign-in.tsx"
6067
'use client';
@@ -100,13 +107,13 @@ const SignOut = ({ onSignOut }: Props) => {
100107
export default SignOut;
101108
```
102109

103-
Recuerda agregar `'use client'` en la parte superior del archivo para indicar que estos componentes son componentes del cliente.
110+
Recuerda agregar `'use client'` en la parte superior del archivo para indicar que estos componentes son componentes cliente.
104111

105112
#### Agregar botones a la pรกgina de inicio \{#add-buttons-to-home-page}
106113

107114
<ServerActionsTip />
108115

109-
Ahora vamos a agregar los botones de inicio y cierre de sesiรณn en tu pรกgina de inicio. Necesitamos llamar a las acciones del servidor en el SDK cuando sea necesario. Para ayudar con esto, usa `getLogtoContext` para obtener el estado de autenticaciรณn.
116+
Ahora vamos a agregar los botones de inicio y cierre de sesiรณn en tu pรกgina de inicio. Necesitamos llamar a las acciones del servidor en el SDK cuando sea necesario. Para ayudarte con esto, utiliza `getLogtoContext` para obtener el estado de autenticaciรณn.
110117

111118
```tsx title="app/page.tsx"
112119
import { getLogtoContext, signIn, signOut } from '@logto/next/server-actions';

โ€Ži18n/fr/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router/_integration.mdx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@ import { LogtoNextConfig } from '@logto/next';
1515
export const logtoConfig: LogtoNextConfig = {
1616
appId: '<your-application-id>',
1717
appSecret: '<your-app-secret-copied-from-console>',
18-
endpoint: '<your-logto-endpoint>', // Par exemple, http://localhost:3001
19-
baseUrl: '<your-nextjs-app-base-url>', // Par exemple, http://localhost:3000
18+
endpoint: '<your-logto-endpoint>', // Par exemple http://localhost:3001
19+
baseUrl: '<your-nextjs-app-base-url>', // Par exemple http://localhost:3000
2020
cookieSecret: 'complex_password_at_least_32_characters_long',
2121
cookieSecure: process.env.NODE_ENV === 'production',
2222
};
2323
```
2424

25-
### Configurer les URIs de redirection \{#configure-redirect-uris}
25+
**Remarque :**
26+
Si vous utilisez une variable d'environnement pour `cookieSecret` (par exemple, `process.env.LOGTO_COOKIE_SECRET`), assurez-vous que la valeur comporte au moins 32 caractรจres. Si cette exigence n'est pas respectรฉe, Logto gรฉnรฉrera l'erreur suivante lors de la compilation ou de l'exรฉcution :
27+
28+
`TypeError: Either sessionWrapper or encryptionKey must be provided for CookieStorage`
29+
30+
Pour รฉviter cette erreur, assurez-vous que la variable d'environnement est correctement dรฉfinie ou fournissez une valeur de secours d'une longueur minimale de 32 caractรจres.
31+
32+
### Configurer les URI de redirection \{#configure-redirect-uris}
2633

2734
<SignInFlowSummary />
2835

@@ -32,9 +39,9 @@ export const logtoConfig: LogtoNextConfig = {
3239

3340
### Gรฉrer le callback \{#handle-callback}
3441

35-
Aprรจs que l'utilisateur se soit connectรฉ, Logto redirigera l'utilisateur vers l'URI de redirection configurรฉe ci-dessus. Cependant, il reste des choses ร  faire pour que votre application fonctionne correctement.
42+
Aprรจs la connexion de l'utilisateur, Logto le redirigera vers l'URI de redirection configurรฉe ci-dessus. Cependant, il reste encore des รฉtapes ร  effectuer pour que votre application fonctionne correctement.
3643

37-
Nous fournissons une fonction d'assistance `handleSignIn` pour gรฉrer le callback de connexion :
44+
Nous fournissons une fonction utilitaire `handleSignIn` pour gรฉrer le callback de connexion :
3845

3946
```tsx title="app/callback/route.ts"
4047
import { handleSignIn } from '@logto/next/server-actions';
@@ -52,9 +59,9 @@ export async function GET(request: NextRequest) {
5259

5360
### Implรฉmenter la connexion et la dรฉconnexion \{#implement-sign-in-and-sign-out}
5461

55-
#### Implรฉmenter le bouton de connexion et de dรฉconnexion \{#implement-sign-in-and-sign-out-button}
62+
#### Implรฉmenter les boutons de connexion et de dรฉconnexion \{#implement-sign-in-and-sign-out-button}
5663

57-
Dans Next.js App Router, les รฉvรฉnements sont gรฉrรฉs dans les composants clients, nous devons donc crรฉer d'abord deux composants : `SignIn` et `SignOut`.
64+
Dans Next.js App Router, les รฉvรฉnements sont gรฉrรฉs dans les composants client, nous devons donc d'abord crรฉer deux composants : `SignIn` et `SignOut`.
5865

5966
```tsx title="app/sign-in.tsx"
6067
'use client';
@@ -100,13 +107,13 @@ const SignOut = ({ onSignOut }: Props) => {
100107
export default SignOut;
101108
```
102109

103-
N'oubliez pas d'ajouter `'use client'` en haut du fichier pour indiquer que ces composants sont des composants clients.
110+
N'oubliez pas d'ajouter `'use client'` en haut du fichier pour indiquer que ces composants sont des composants client.
104111

105112
#### Ajouter les boutons ร  la page d'accueil \{#add-buttons-to-home-page}
106113

107114
<ServerActionsTip />
108115

109-
Ajoutons maintenant les boutons de connexion et de dรฉconnexion sur votre page d'accueil. Nous devons appeler les actions serveur dans le SDK lorsque cela est nรฉcessaire. Pour vous aider, utilisez `getLogtoContext` pour rรฉcupรฉrer le statut d'authentification.
116+
Ajoutons maintenant les boutons de connexion et de dรฉconnexion sur votre page d'accueil. Nous devons appeler les actions serveur du SDK lorsque cela est nรฉcessaire. Pour cela, utilisez `getLogtoContext` pour rรฉcupรฉrer le statut d'authentification.
110117

111118
```tsx title="app/page.tsx"
112119
import { getLogtoContext, signIn, signOut } from '@logto/next/server-actions';

โ€Ži18n/ja/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router/_integration.mdx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ServerActionsTip from './_server-actions-tip.mdx';
77

88
### ่จญๅฎšใฎๆบ–ๅ‚™ \{#prepare-configs}
99

10-
Logto ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใฎ่จญๅฎšใ‚’ๆบ–ๅ‚™ใ—ใพใ™๏ผš
10+
Logto ใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆ็”จใฎ่จญๅฎšใ‚’ๆบ–ๅ‚™ใ—ใพใ™๏ผš
1111

1212
```ts title="app/logto.ts"
1313
import { LogtoNextConfig } from '@logto/next';
@@ -22,6 +22,13 @@ export const logtoConfig: LogtoNextConfig = {
2222
};
2323
```
2424

25+
**ๆณจๆ„:**
26+
`cookieSecret` ใซ็’ฐๅขƒๅค‰ๆ•ฐ๏ผˆไพ‹: `process.env.LOGTO_COOKIE_SECRET`๏ผ‰ใ‚’ไฝฟ็”จใ™ใ‚‹ๅ ดๅˆใ€ใใฎๅ€คใŒ 32 ๆ–‡ๅญ—ไปฅไธŠใงใ‚ใ‚‹ใ“ใจใ‚’็ขบ่ชใ—ใฆใใ ใ•ใ„ใ€‚ใ“ใฎ่ฆไปถใ‚’ๆบ€ใŸใ•ใชใ„ๅ ดๅˆใ€Logto ใฏใƒ“ใƒซใƒ‰ใพใŸใฏๅฎŸ่กŒๆ™‚ใซๆฌกใฎใ‚จใƒฉใƒผใ‚’ใ‚นใƒญใƒผใ—ใพใ™๏ผš
27+
28+
`TypeError: Either sessionWrapper or encryptionKey must be provided for CookieStorage`
29+
30+
ใ“ใฎใ‚จใƒฉใƒผใ‚’้˜ฒใใซใฏใ€็’ฐๅขƒๅค‰ๆ•ฐใŒๆญฃใ—ใ่จญๅฎšใ•ใ‚Œใฆใ„ใ‚‹ใ‹ใ€ใพใŸใฏ 32 ๆ–‡ๅญ—ไปฅไธŠใฎใƒ•ใ‚ฉใƒผใƒซใƒใƒƒใ‚ฏๅ€คใ‚’็”จๆ„ใ—ใฆใใ ใ•ใ„ใ€‚
31+
2532
### ใƒชใƒ€ใ‚คใƒฌใ‚ฏใƒˆ URI ใฎ่จญๅฎš \{#configure-redirect-uris}
2633

2734
<SignInFlowSummary />
@@ -32,9 +39,9 @@ export const logtoConfig: LogtoNextConfig = {
3239

3340
### ใ‚ณใƒผใƒซใƒใƒƒใ‚ฏใฎๅ‡ฆ็† \{#handle-callback}
3441

35-
ใƒฆใƒผใ‚ถใƒผใŒใ‚ตใ‚คใƒณใ‚คใƒณใ—ใŸๅพŒใ€Logto ใฏใƒฆใƒผใ‚ถใƒผใ‚’ไธŠ่จ˜ใง่จญๅฎšใ—ใŸใƒชใƒ€ใ‚คใƒฌใ‚ฏใƒˆ URI ใซๆˆปใ—ใพใ™ใ€‚ใ—ใ‹ใ—ใ€ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใŒๆญฃใ—ใๅ‹•ไฝœใ™ใ‚‹ใŸใ‚ใซใฏใ€ใพใ ่กŒใ†ในใใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚
42+
ใƒฆใƒผใ‚ถใƒผใŒใ‚ตใ‚คใƒณใ‚คใƒณใ—ใŸๅพŒใ€Logto ใฏไธŠ่จ˜ใง่จญๅฎšใ—ใŸใƒชใƒ€ใ‚คใƒฌใ‚ฏใƒˆ URI ใซใƒฆใƒผใ‚ถใƒผใ‚’ใƒชใƒ€ใ‚คใƒฌใ‚ฏใƒˆใ—ใพใ™ใ€‚ใŸใ ใ—ใ€ใ‚ขใƒ—ใƒชใ‚ฑใƒผใ‚ทใƒงใƒณใŒๆญฃใ—ใๅ‹•ไฝœใ™ใ‚‹ใŸใ‚ใซใฏใ€ใพใ ใ‚„ใ‚‹ในใใ“ใจใŒใ‚ใ‚Šใพใ™ใ€‚
3643

37-
ใ‚ตใ‚คใƒณใ‚คใƒณใ‚ณใƒผใƒซใƒใƒƒใ‚ฏใ‚’ๅ‡ฆ็†ใ™ใ‚‹ใŸใ‚ใซใ€`handleSignIn` ใจใ„ใ†ใƒ˜ใƒซใƒ‘ใƒผ้–ขๆ•ฐใ‚’ๆไพ›ใ—ใฆใ„ใพใ™๏ผš
44+
ใ‚ตใ‚คใƒณใ‚คใƒณใ‚ณใƒผใƒซใƒใƒƒใ‚ฏใ‚’ๅ‡ฆ็†ใ™ใ‚‹ใŸใ‚ใฎใƒ˜ใƒซใƒ‘ใƒผ้–ขๆ•ฐ `handleSignIn` ใ‚’ๆไพ›ใ—ใฆใ„ใพใ™๏ผš
3845

3946
```tsx title="app/callback/route.ts"
4047
import { handleSignIn } from '@logto/next/server-actions';
@@ -50,9 +57,9 @@ export async function GET(request: NextRequest) {
5057
}
5158
```
5259

53-
### ใ‚ตใ‚คใƒณใ‚คใƒณใจใ‚ตใ‚คใƒณใ‚ขใ‚ฆใƒˆใฎๅฎŸ่ฃ… \{#implement-sign-in-and-sign-out}
60+
### ใ‚ตใ‚คใƒณใ‚คใƒณใƒปใ‚ตใ‚คใƒณใ‚ขใ‚ฆใƒˆใฎๅฎŸ่ฃ… \{#implement-sign-in-and-sign-out}
5461

55-
#### ใ‚ตใ‚คใƒณใ‚คใƒณใจใ‚ตใ‚คใƒณใ‚ขใ‚ฆใƒˆใƒœใ‚ฟใƒณใฎๅฎŸ่ฃ… \{#implement-sign-in-and-sign-out-button}
62+
#### ใ‚ตใ‚คใƒณใ‚คใƒณใƒปใ‚ตใ‚คใƒณใ‚ขใ‚ฆใƒˆใƒœใ‚ฟใƒณใฎๅฎŸ่ฃ… \{#implement-sign-in-and-sign-out-button}
5663

5764
Next.js App Router ใงใฏใ€ใ‚คใƒ™ใƒณใƒˆใฏใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใงๅ‡ฆ็†ใ•ใ‚Œใ‚‹ใŸใ‚ใ€ใพใš `SignIn` ใจ `SignOut` ใฎ 2 ใคใฎใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใ‚’ไฝœๆˆใ™ใ‚‹ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ใ€‚
5865

@@ -100,13 +107,13 @@ const SignOut = ({ onSignOut }: Props) => {
100107
export default SignOut;
101108
```
102109

103-
ใ“ใ‚Œใ‚‰ใฎใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใŒใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใงใ‚ใ‚‹ใ“ใจใ‚’็คบใ™ใŸใ‚ใซใ€ใƒ•ใ‚กใ‚คใƒซใฎๅ…ˆ้ ญใซ `'use client'` ใ‚’่ฟฝๅŠ ใ™ใ‚‹ใ“ใจใ‚’ๅฟ˜ใ‚Œใชใ„ใงใใ ใ•ใ„ใ€‚
110+
ใ“ใ‚Œใ‚‰ใฎใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใŒใ‚ฏใƒฉใ‚คใ‚ขใƒณใƒˆใ‚ณใƒณใƒใƒผใƒใƒณใƒˆใงใ‚ใ‚‹ใ“ใจใ‚’็คบใ™ใŸใ‚ใ€ใƒ•ใ‚กใ‚คใƒซใฎๅ…ˆ้ ญใซ `'use client'` ใ‚’่ฟฝๅŠ ใ™ใ‚‹ใ“ใจใ‚’ๅฟ˜ใ‚Œใชใ„ใงใใ ใ•ใ„ใ€‚
104111

105112
#### ใƒ›ใƒผใƒ ใƒšใƒผใ‚ธใซใƒœใ‚ฟใƒณใ‚’่ฟฝๅŠ  \{#add-buttons-to-home-page}
106113

107114
<ServerActionsTip />
108115

109-
ๆฌกใซใ€ใƒ›ใƒผใƒ ใƒšใƒผใ‚ธใซใ‚ตใ‚คใƒณใ‚คใƒณใจใ‚ตใ‚คใƒณใ‚ขใ‚ฆใƒˆใฎใƒœใ‚ฟใƒณใ‚’่ฟฝๅŠ ใ—ใพใ™ใ€‚ๅฟ…่ฆใซๅฟœใ˜ใฆ SDK ใฎใ‚ตใƒผใƒใƒผใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‘ผใณๅ‡บใ™ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ใ€‚ใ“ใ‚Œใ‚’ๆ”ฏๆดใ™ใ‚‹ใŸใ‚ใซใ€`getLogtoContext` ใ‚’ไฝฟ็”จใ—ใฆ่ช่จผ (Authentication) ใ‚นใƒ†ใƒผใ‚ฟใ‚นใ‚’ๅ–ๅพ—ใ—ใพใ™ใ€‚
116+
ๆฌกใซใ€ใƒ›ใƒผใƒ ใƒšใƒผใ‚ธใซใ‚ตใ‚คใƒณใ‚คใƒณใƒปใ‚ตใ‚คใƒณใ‚ขใ‚ฆใƒˆใƒœใ‚ฟใƒณใ‚’่ฟฝๅŠ ใ—ใพใ™ใ€‚ๅฟ…่ฆใซๅฟœใ˜ใฆ SDK ใฎใ‚ตใƒผใƒใƒผใ‚ขใ‚ฏใ‚ทใƒงใƒณใ‚’ๅ‘ผใณๅ‡บใ™ๅฟ…่ฆใŒใ‚ใ‚Šใพใ™ใ€‚ใใฎใŸใ‚ใซใ€`getLogtoContext` ใ‚’ไฝฟใฃใฆ่ช่จผ (Authentication) ็Šถๆ…‹ใ‚’ๅ–ๅพ—ใ—ใพใ™ใ€‚
110117

111118
```tsx title="app/page.tsx"
112119
import { getLogtoContext, signIn, signOut } from '@logto/next/server-actions';
@@ -121,7 +128,7 @@ const Home = () => {
121128
<nav>
122129
{isAuthenticated ? (
123130
<p>
124-
ใ“ใ‚“ใซใกใฏ, {claims?.sub},
131+
ใ“ใ‚“ใซใกใฏใ€{claims?.sub} ใ•ใ‚“ใ€
125132
<SignOut
126133
onSignOut={async () => {
127134
'use server';

โ€Ži18n/ko/docusaurus-plugin-content-docs/current/quick-starts/framework/next-app-router/_integration.mdx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SignInFlowSummary from '../../fragments/_web-sign-in-flow-summary.mdx';
55

66
import ServerActionsTip from './_server-actions-tip.mdx';
77

8-
### ๊ตฌ์„ฑ ์ค€๋น„ \{#prepare-configs}
8+
### ๊ตฌ์„ฑ ์ค€๋น„ํ•˜๊ธฐ \{#prepare-configs}
99

1010
Logto ํด๋ผ์ด์–ธํŠธ๋ฅผ ์œ„ํ•œ ๊ตฌ์„ฑ์„ ์ค€๋น„ํ•˜์„ธ์š”:
1111

@@ -22,17 +22,24 @@ export const logtoConfig: LogtoNextConfig = {
2222
};
2323
```
2424

25-
### ๋ฆฌ๋””๋ ‰ํŠธ URI ๊ตฌ์„ฑ \{#configure-redirect-uris}
25+
**์ฐธ๊ณ :**
26+
`cookieSecret`์— ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ (์˜ˆ: `process.env.LOGTO_COOKIE_SECRET`), ๊ฐ’์ด ์ตœ์†Œ 32์ž ์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด ์š”๊ตฌ ์‚ฌํ•ญ์ด ์ถฉ์กฑ๋˜์ง€ ์•Š์œผ๋ฉด, Logto๋Š” ๋นŒ๋“œ ๋˜๋Š” ๋Ÿฐํƒ€์ž„ ์ค‘์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค:
27+
28+
`TypeError: Either sessionWrapper or encryptionKey must be provided for CookieStorage`
29+
30+
์ด ์˜ค๋ฅ˜๋ฅผ ๋ฐฉ์ง€ํ•˜๋ ค๋ฉด ํ™˜๊ฒฝ ๋ณ€์ˆ˜๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ๊ฑฐ๋‚˜, ์ตœ์†Œ ๊ธธ์ด 32์ž์˜ ๋Œ€์ฒด ๊ฐ’์„ ์ œ๊ณตํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
31+
32+
### ๋ฆฌ๋””๋ ‰์…˜ URI ๊ตฌ์„ฑํ•˜๊ธฐ \{#configure-redirect-uris}
2633

2734
<SignInFlowSummary />
2835

2936
<AssumingUrl />
3037

3138
<WebConfigureRedirectUris />
3239

33-
### ์ฝœ๋ฐฑ ์ฒ˜๋ฆฌ \{#handle-callback}
40+
### ์ฝœ๋ฐฑ ์ฒ˜๋ฆฌํ•˜๊ธฐ \{#handle-callback}
3441

35-
์‚ฌ์šฉ์ž๊ฐ€ ๋กœ๊ทธ์ธํ•œ ํ›„, Logto๋Š” ์‚ฌ์šฉ์ž๋ฅผ ์œ„์—์„œ ๊ตฌ์„ฑํ•œ ๋ฆฌ๋””๋ ‰ํŠธ URI๋กœ ๋‹ค์‹œ ๋ฆฌ๋””๋ ‰์…˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜๋„๋ก ํ•˜๊ธฐ ์œ„ํ•ด ํ•ด์•ผ ํ•  ์ผ์ด ๋‚จ์•„ ์žˆ์Šต๋‹ˆ๋‹ค.
42+
์‚ฌ์šฉ์ž๊ฐ€ ๋กœ๊ทธ์ธํ•œ ํ›„, Logto๋Š” ์œ„์—์„œ ๊ตฌ์„ฑํ•œ ๋ฆฌ๋””๋ ‰์…˜ URI๋กœ ์‚ฌ์šฉ์ž๋ฅผ ๋‹ค์‹œ ๋ฆฌ๋””๋ ‰์…˜ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜๋ ค๋ฉด ์ถ”๊ฐ€ ์ž‘์—…์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
3643

3744
๋กœ๊ทธ์ธ ์ฝœ๋ฐฑ์„ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด `handleSignIn` ํ—ฌํผ ํ•จ์ˆ˜๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค:
3845

@@ -50,9 +57,9 @@ export async function GET(request: NextRequest) {
5057
}
5158
```
5259

53-
### ๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ ๊ตฌํ˜„ \{#implement-sign-in-and-sign-out}
60+
### ๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ ๊ตฌํ˜„ํ•˜๊ธฐ \{#implement-sign-in-and-sign-out}
5461

55-
#### ๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ ๊ตฌํ˜„ \{#implement-sign-in-and-sign-out-button}
62+
#### ๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ ๊ตฌํ˜„ํ•˜๊ธฐ \{#implement-sign-in-and-sign-out-button}
5663

5764
Next.js App Router์—์„œ๋Š” ์ด๋ฒคํŠธ๊ฐ€ ํด๋ผ์ด์–ธํŠธ ์ปดํฌ๋„ŒํŠธ์—์„œ ์ฒ˜๋ฆฌ๋˜๋ฏ€๋กœ, ๋จผ์ € `SignIn`๊ณผ `SignOut` ๋‘ ๊ฐœ์˜ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
5865

@@ -102,11 +109,11 @@ export default SignOut;
102109

103110
์ด ์ปดํฌ๋„ŒํŠธ๋“ค์ด ํด๋ผ์ด์–ธํŠธ ์ปดํฌ๋„ŒํŠธ์ž„์„ ๋‚˜ํƒ€๋‚ด๊ธฐ ์œ„ํ•ด ํŒŒ์ผ ์ƒ๋‹จ์— `'use client'`๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์„ ์žŠ์ง€ ๋งˆ์„ธ์š”.
104111

105-
#### ํ™ˆ ํŽ˜์ด์ง€์— ๋ฒ„ํŠผ ์ถ”๊ฐ€ \{#add-buttons-to-home-page}
112+
#### ํ™ˆ ํŽ˜์ด์ง€์— ๋ฒ„ํŠผ ์ถ”๊ฐ€ํ•˜๊ธฐ \{#add-buttons-to-home-page}
106113

107114
<ServerActionsTip />
108115

109-
์ด์ œ ํ™ˆ ํŽ˜์ด์ง€์— ๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ์„ ์ถ”๊ฐ€ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ํ•„์š”ํ•  ๋•Œ SDK์—์„œ ์„œ๋ฒ„ ์•ก์…˜์„ ํ˜ธ์ถœํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ๋•๊ธฐ ์œ„ํ•ด `getLogtoContext`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ธ์ฆ ์ƒํƒœ๋ฅผ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
116+
์ด์ œ ํ™ˆ ํŽ˜์ด์ง€์— ๋กœ๊ทธ์ธ ๋ฐ ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ์„ ์ถ”๊ฐ€ํ•ด ๋ด…์‹œ๋‹ค. ํ•„์š”ํ•  ๋•Œ SDK์˜ ์„œ๋ฒ„ ์•ก์…˜์„ ํ˜ธ์ถœํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ๋•๊ธฐ ์œ„ํ•ด `getLogtoContext`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ธ์ฆ (Authentication) ์ƒํƒœ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
110117

111118
```tsx title="app/page.tsx"
112119
import { getLogtoContext, signIn, signOut } from '@logto/next/server-actions';

0 commit comments

Comments
ย (0)