Skip to content

Commit 437d9b8

Browse files
committed
chore: add required callouts
1 parent e032de5 commit 437d9b8

File tree

2 files changed

+12
-0
lines changed
  • src/pages
    • [platform]/build-a-backend/server-side-rendering
    • gen1/[platform]/build-a-backend/server-side-rendering/nextjs

2 files changed

+12
-0
lines changed

src/pages/[platform]/build-a-backend/server-side-rendering/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ AMPLIFY_APP_ORIGIN=https://myapp.com
238238

239239
Ensure this environment variables is accessible in your Next.js app's server runtime.
240240

241+
> **Note:** Token cookies are transmitted via server-side authentication flows. In production environments, it is recommended to use HTTPS as the origin for enhanced security.
242+
241243
**Step 2 - Export the `createAuthRouteHandlers` function**
242244

243245
`createAuthRouteHandlers` function is created by the `createServerRunner` function call when you configure Amplify for server-side usage. You can export this function from your `amplifyServerUtils.ts` file. You can also configure cookie attributes with the `runtimeOptions` parameter.
@@ -303,6 +305,10 @@ With the above example, Amplify generates the following API routes:
303305
| `/api/auth/sign-in-callback` | Amazon Cognito Managed Login redirects users back to this route after signing in. Amplify exchanges auth tokens and stores them as HTTP-only cookies in the browser cookie store. |
304306
| `/api/auth/sign-out-callback` | Amazon Cognito Managed Login redirects an end user back to this router after signing out, Amplify revokes access token and refresh token and removes token cookies from browser cookie store. |
305307

308+
> **Note:** A signing-out call involves multiple steps, including signing out from Amazon Cognito Managed Login, revoking tokens, and removing cookies. If the user closes the browser during the process, the following may occur:
309+
>
310+
> 1. auth token have not been revoked - user remains signed in
311+
> 2. auth token have been revoked but cookies have not been removed - cookies will be removed when the user visits the app again
306312
307313
**Step 4 - Provide the redirect URLs to the Auth Resource in Amplify**
308314

src/pages/gen1/[platform]/build-a-backend/server-side-rendering/nextjs/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ AMPLIFY_APP_ORIGIN=https://myapp.com
240240

241241
Ensure this environment variables is accessible in your Next.js app's server runtime.
242242

243+
> **Note:** Token cookies are transmitted via server-side authentication flows. In production environments, it is recommended to use HTTPS as the origin for enhanced security.
244+
243245
**Step 2 - Export the `createAuthRouteHandlers` function**
244246

245247
`createAuthRouteHandlers` function is created by the `createServerRunner` function call when you configure Amplify for server-side usage. You can export this function from your `amplifyServerUtils.ts` file. You can also configure cookie attributes with the `runtimeOptions` parameter.
@@ -305,6 +307,10 @@ With the above example, Amplify generates the following API routes:
305307
| `/api/auth/sign-in-callback` | Amazon Cognito Managed Login redirects users back to this route after signing in. Amplify exchanges auth tokens and stores them as HTTP-only cookies in the browser cookie store. |
306308
| `/api/auth/sign-out-callback` | Amazon Cognito Managed Login redirects an end user back to this router after signing out, Amplify revokes access token and refresh token and removes token cookies from browser cookie store. |
307309

310+
> **Note:** A signing-out call involves multiple steps, including signing out from Amazon Cognito Managed Login, revoking tokens, and removing cookies. If the user closes the browser during the process, the following may occur:
311+
>
312+
> 1. auth token have not been revoked - user remains signed in
313+
> 2. auth token have been revoked but cookies have not been removed - cookies will be removed when the user visits the app again
308314
309315
**Step 4 - Provide the redirect URLs to the Auth Resource in Amplify**
310316

0 commit comments

Comments
 (0)