Skip to content

Commit 6852eff

Browse files
Updating with-supertokens example (#29876)
Updating dependency of supertokens-node and providing development OAuth keys for google and github for quicker setup.
1 parent f2cf092 commit 6852eff

File tree

4 files changed

+12
-55
lines changed

4 files changed

+12
-55
lines changed

examples/with-supertokens/.env.local.example

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/with-supertokens/README.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
This is a simple set up for applications protected by SuperTokens.
44

5-
## Deploy your own
6-
7-
Deploy the example using [Vercel](https://vercel.com):
8-
9-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-supertokens&project-name=with-supertokens&repository-name=with-supertokens)
10-
115
## How to use
126

137
- Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
@@ -22,28 +16,6 @@ yarn create next-app --example with-supertokens with-supertokens-app
2216

2317
- Run `npm run dev` to start the application on `http://localhost:3000`.
2418

25-
## Configuration
26-
27-
> Until you do this, social login will not work. But you can still try out email password sign up / in.
28-
29-
- Create a `.env.local` file and copy the content of `.env.local.example` into it:
30-
31-
```bash
32-
cp .env.local.example .env.local
33-
```
34-
35-
- Fill in the values for your social login secrets
36-
37-
## Deploy on Vercel
38-
39-
You can deploy this app to the cloud with [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
40-
41-
### Deploy Your Local Project
42-
43-
To deploy your local project to Vercel, push it to GitHub/GitLab/Bitbucket and [import to Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example).
44-
45-
**Important**: When you import your project on Vercel, make sure to click on **Environment Variables** and set them to match your `.env.local` file.
46-
4719
## Notes
4820

4921
Take a look at [SuperTokens documentation](https://supertokens.io/docs/community/introduction).

examples/with-supertokens/config/supertokensConfig.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,21 @@ export let backendConfig = () => {
2828
recipeList: [
2929
ThirdPartyEmailPasswordNode.init({
3030
providers: [
31+
// We have provided you with development keys which you can use for testing.
32+
// IMPORTANT: Please replace them with your own OAuth keys for production use.
3133
ThirdPartyEmailPasswordNode.Google({
32-
clientSecret: process.env.GOOGLE_CLIENT_SECRET || 'PLACEHOLDER',
33-
clientId: process.env.GOOGLE_CLIENT_ID || 'PLACEHOLDER',
34+
clientId:
35+
'1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com',
36+
clientSecret: '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',
3437
}),
3538
ThirdPartyEmailPasswordNode.Github({
36-
clientSecret: process.env.GITHUB_CLIENT_SECRET || 'PLACEHOLDER',
37-
clientId: process.env.GITHUB_CLIENT_ID || 'PLACEHOLDER',
38-
}),
39-
ThirdPartyEmailPasswordNode.Facebook({
40-
clientSecret: process.env.FACEBOOK_CLIENT_SECRET || 'PLACEHOLDER',
41-
clientId: process.env.FACEBOOK_CLIENT_ID || 'PLACEHOLDER',
39+
clientId: '467101b197249757c71f',
40+
clientSecret: 'e97051221f4b6426e8fe8d51486396703012f5bd',
4241
}),
42+
// ThirdPartyEmailPasswordNode.Facebook({
43+
// clientSecret: process.env.FACEBOOK_CLIENT_SECRET || 'PLACEHOLDER',
44+
// clientId: process.env.FACEBOOK_CLIENT_ID || 'PLACEHOLDER',
45+
// }),
4346
],
4447
}),
4548
SessionNode.init(),
@@ -60,7 +63,6 @@ export let frontendConfig = () => {
6063
providers: [
6164
ThirdPartyEmailPasswordReact.Google.init(),
6265
ThirdPartyEmailPasswordReact.Github.init(),
63-
ThirdPartyEmailPasswordReact.Facebook.init(),
6466
],
6567
},
6668
}),

examples/with-supertokens/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"react": "17.0.1",
1111
"react-dom": "17.0.1",
1212
"supertokens-auth-react": "^0.16.0",
13-
"supertokens-node": "^7.0.0"
13+
"supertokens-node": "^7.3.0"
1414
},
1515
"devDependencies": {
1616
"eslint-config-next": "11.0.1"

0 commit comments

Comments
 (0)