Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/seamless-service-token-env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@seamless-auth/react': patch
---

The README's Next.js example reads the service token from `SEAMLESS_SERVICE_TOKEN` instead of `API_SERVICE_TOKEN`. The auth server still reads `API_SERVICE_TOKEN`; both hold the same value.
7 changes: 5 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export const { GET, POST, PUT, PATCH, DELETE } = createSeamlessAuthHandler({
authServerUrl: process.env.AUTH_SERVER_URL!,
audience: process.env.AUTH_SERVER_URL!,
cookieSecret: process.env.COOKIE_SIGNING_KEY!,
serviceSecret: process.env.API_SERVICE_TOKEN!,
serviceSecret: process.env.SEAMLESS_SERVICE_TOKEN!,
jwksKid: process.env.JWKS_KID,
});
```
Expand All @@ -152,7 +152,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
const session = await getSeamlessSession(await cookies(), {
authServerUrl: process.env.AUTH_SERVER_URL!,
cookieSecret: process.env.COOKIE_SIGNING_KEY!,
serviceSecret: process.env.API_SERVICE_TOKEN!,
serviceSecret: process.env.SEAMLESS_SERVICE_TOKEN!,
jwksKid: process.env.JWKS_KID,
userAgent: (await headers()).get('user-agent') ?? undefined,
});
Expand All @@ -174,6 +174,9 @@ handler above. The full guide, including route protection in `proxy.ts`, is at
[docs.seamlessauth.com/build/nextjs](https://docs.seamlessauth.com/build/nextjs/), and
`seamless init my-app --nextjs` scaffolds a working starter.

The auth server reads the service token from `API_SERVICE_TOKEN` and the app reads it from
`SEAMLESS_SERVICE_TOKEN`; both hold the same value.

Things to know:

- **Use custom UI, not `AuthRoutes`.** The bundled screens route with react-router, which a Next.js
Expand Down
Loading