Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Add secretKey in next.js auth examples (#350)
Browse files Browse the repository at this point in the history
* Add secretKey in next.js auth examples

* update
  • Loading branch information
MananTank authored Apr 19, 2024
1 parent 83e944e commit 8ec2113
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"flexsearch": "^0.7.31",
"github-slugger": "^2.0.0",
"lucide-react": "^0.286.0",
"next": "~13.4",
"next": "13.4",
"nextjs-toploader": "^1.5.3",
"node-html-parser": "^6.1.11",
"posthog-js": "^1.96.1",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/app/connect/auth/get-started/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ import { PrivateKeyWallet } from "@thirdweb-dev/auth/evm";
export const { ThirdwebAuthHandler, getUser } = ThirdwebAuth({
domain: process.env.NEXT_PUBLIC_THIRDWEB_AUTH_DOMAIN || "",
wallet: new PrivateKeyWallet(process.env.THIRDWEB_AUTH_PRIVATE_KEY || ""),
thirdwebAuthOptions: {
secretKey: "...",
},
});

// Use the ThirdwebAuthHandler as the default export to handle all requests to /api/auth/*
Expand Down
6 changes: 6 additions & 0 deletions src/app/connect/auth/server-frameworks/express/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const app = express();
const { authRouter, authMiddleware, getUser } = ThirdwebAuth({
domain: process.env.THIRDWEB_AUTH_DOMAIN || "",
wallet: new PrivateKeyWallet(process.env.THIRDWEB_AUTH_PRIVATE_KEY || ""),
thirdwebAuthOptions: {
secretKey: "...",
},
});

// Add the auth router to our app to set up the /auth/* endpoints
Expand Down Expand Up @@ -176,6 +179,9 @@ export const { ThirdwebAuthHandler, getUser } = ThirdwebAuth({
authOptions: {
tokenDurationInSeconds: 60 * 60 * 24 * 7, // 1 week
},
thirdwebAuthOptions: {
secretKey: "...",
},
});
```

Expand Down
6 changes: 6 additions & 0 deletions src/app/connect/auth/server-frameworks/next/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ import { PrivateKeyWallet } from "@thirdweb-dev/auth/evm";
export const { ThirdwebAuthHandler, getUser } = ThirdwebAuth({
domain: "example.com",
wallet: new PrivateKeyWallet(process.env.THIRDWEB_AUTH_PRIVATE_KEY || ""),
thirdwebAuthOptions: {
secretKey: "...",
},
});

export default ThirdwebAuthHandler();
Expand Down Expand Up @@ -96,6 +99,9 @@ import { PrivateKeyWallet } from "@thirdweb-dev/auth/evm";
export const { ThirdwebAuthHandler, getUser } = ThirdwebAuthAppRouter({
domain: "example.com",
wallet: new PrivateKeyWallet(process.env.THIRDWEB_AUTH_PRIVATE_KEY || ""),
thirdwebAuthOptions: {
secretKey: "...",
},
});
```

Expand Down

0 comments on commit 8ec2113

Please sign in to comment.