Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to with-supertokens example app #53434

Merged
merged 190 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
7e044a9
add-supertokens-to-authentication.md
Feb 16, 2021
8e5bd92
Merge branch 'canary' into with-supertokens-example-in-docs
Feb 18, 2021
e290993
bump supertokens deps
kant01ne Feb 18, 2021
0fecb52
update SuperTokens Auth doc
kant01ne Mar 1, 2021
055047b
Merge branch 'canary' into with-supertokens-example-in-docs
Mar 1, 2021
49caedd
Update docs/authentication.md
Mar 1, 2021
a00f6a5
Update docs/authentication.md
Mar 1, 2021
fa05b78
updates supertokens dependency and optimises for serverless execution
rishabhpoddar Apr 6, 2021
0af47ee
updates with original repo
rishabhpoddar Apr 6, 2021
feab6fb
runs prettier-fix
rishabhpoddar Apr 6, 2021
5d8c319
Merge branch 'canary' into canary
rishabhpoddar Apr 6, 2021
7a50823
adds supertokens to 'Bring Your Own Database' section as well
rishabhpoddar Apr 7, 2021
05795a5
Merge branch 'canary' into canary
rishabhpoddar Apr 7, 2021
b44c159
does not show home page if not logged in
rishabhpoddar Apr 8, 2021
ca44249
extracts config into its own file and calls it in all serverless func…
rishabhpoddar Apr 8, 2021
13ad8f2
removes need for backend init in app.jsx
rishabhpoddar Apr 8, 2021
83a8369
simplifies use of dynamic
rishabhpoddar Apr 8, 2021
88f9193
Merge branch 'canary' into canary
rishabhpoddar Apr 8, 2021
39a850e
refreshes page after getServerSideProps
rishabhpoddar Apr 8, 2021
1007e80
removes unnecessary check in API
rishabhpoddar Apr 8, 2021
d0c8a19
Merge branch 'canary' into canary
rishabhpoddar Apr 8, 2021
6f05b35
update to docs pertaining SuperTokens
rishabhpoddar Apr 8, 2021
80e72e9
adds placeholder secrets so that the UI loads on first run
rishabhpoddar Apr 9, 2021
bbf27a2
changes to readme
rishabhpoddar Apr 9, 2021
52e423b
updates version of supertokens frontend and backend SDK, and a few ot…
rishabhpoddar Apr 16, 2021
93b6588
Merge branch 'canary' into canary
rishabhpoddar Apr 16, 2021
c88554b
Update docs/authentication.md
rishabhpoddar Apr 20, 2021
121c5ae
Merge branch 'canary' into canary
rishabhpoddar Apr 20, 2021
3f8906b
Merge branch 'canary' into canary
rishabhpoddar Apr 20, 2021
5c7bf78
updates to readme for supertokens example
rishabhpoddar Apr 21, 2021
472ce2c
updates version of dependency
rishabhpoddar Apr 28, 2021
3f511eb
Merge branch 'canary' into canary
rishabhpoddar Apr 28, 2021
58b5e12
Merge branch 'canary' into canary
rishabhpoddar Apr 28, 2021
d2288cc
updates dependency version
rishabhpoddar May 3, 2021
687a9cb
Merge branch 'canary' into canary
rishabhpoddar May 3, 2021
4f8a48c
updates to dependencies
rishabhpoddar May 5, 2021
8976fa2
removes unnecessary config on frontend
rishabhpoddar May 5, 2021
889f8a4
Merge branch 'canary' into canary
rishabhpoddar May 5, 2021
652211c
changes how redirection is done post signout
rishabhpoddar May 12, 2021
538d794
update to dependency
rishabhpoddar May 13, 2021
a3f900c
Merge branch 'canary' into canary
rishabhpoddar May 13, 2021
0769b24
updates examples
rishabhpoddar Jun 17, 2021
2492e03
Merge branch 'canary' into canary
rishabhpoddar Jun 17, 2021
381c26f
updates code to use for new package
super-tokens Jul 11, 2021
8aef52c
updates dependencies
super-tokens Jul 11, 2021
3c88891
updates auth-react package
super-tokens Jul 11, 2021
a139dcc
Merge branch 'canary' of https://github.com/supertokens/next.js into …
super-tokens Jul 12, 2021
36e174c
Merge branch 'canary' into canary
rishabhpoddar Jul 12, 2021
0bfff12
with-supertokens example updated to use supertokens-node v7
bhumilsarvaiya Aug 26, 2021
8aeaa0e
updates dependency
super-tokens Aug 26, 2021
668eae4
Merge pull request #1 from supertokens/supertokens-node-7.x
rishabhpoddar Sep 8, 2021
33475d5
updates supertokens-node version
super-tokens Sep 8, 2021
be81b86
Merge branch 'canary' into canary
rishabhpoddar Sep 8, 2021
f1bf8dc
Update examples/with-supertokens/package.json
rishabhpoddar Sep 8, 2021
a10a2de
Merge branch 'canary' into canary
rishabhpoddar Sep 8, 2021
f8b8cd5
Merge branch 'canary' into canary
rishabhpoddar Sep 9, 2021
b7404ea
Merge branch 'canary' into canary
rishabhpoddar Sep 9, 2021
fbedc66
updates based on check-examples.sh script
super-tokens Sep 9, 2021
9a3b04a
linter fix
super-tokens Sep 9, 2021
a74b64a
updates supertokens-auth-react dependency version
super-tokens Oct 1, 2021
cd91f4f
Merge branch 'canary' into canary
rishabhpoddar Oct 1, 2021
a16c4b5
adds development OAuth key to example
jscyo Oct 13, 2021
d767c93
removes section from README
jscyo Oct 13, 2021
35b1fdd
Merge pull request #2 from supertokens/dev-oauth-keys
rishabhpoddar Oct 13, 2021
c06c01d
removes unnecessary file
super-tokens Oct 13, 2021
c723aae
Merge branch 'canary' into canary
rishabhpoddar Oct 13, 2021
b1afa9b
Merge branch 'canary' into canary
rishabhpoddar Oct 13, 2021
805e464
Merge branch 'canary' into canary
rishabhpoddar Oct 20, 2021
26efb9b
updates dependency versions
super-tokens Oct 22, 2021
0011b06
Merge branch 'canary' into canary
rishabhpoddar Oct 22, 2021
a6289b0
Merge branch 'canary' into canary
rishabhpoddar Oct 27, 2021
4d75763
Merge branch 'canary' into canary
rishabhpoddar Oct 31, 2021
9f915d1
Merge branch 'canary' into canary
rishabhpoddar Nov 1, 2021
31380c7
with-supertokens: reduced bundle size by removing node lib from bundle
Oct 29, 2021
d2986e4
Removed accidentally added config file
Nov 3, 2021
09f7911
Merge branch 'canary' into supertokens-reduced-bundle-size
super-tokens Nov 5, 2021
410bb9c
Merge pull request #3 from supertokens/supertokens-reduced-bundle-size
rishabhpoddar Nov 5, 2021
2736f86
Merge branch 'canary' into canary
rishabhpoddar Nov 6, 2021
c780496
adds sign in with apple
super-tokens Nov 9, 2021
2846bd0
Merge branch 'canary' into canary
rishabhpoddar Nov 9, 2021
7e6b654
Merge branch 'canary' into canary
rishabhpoddar Nov 9, 2021
cf5939b
extracted oauth keys to .env file
super-tokens Nov 9, 2021
72224ff
Merge branch 'canary' into canary
rishabhpoddar Nov 9, 2021
f29e792
Merge branch 'canary' into canary
jscyo Nov 9, 2021
83df50a
Merge branch 'canary' into canary
jscyo Nov 10, 2021
62462d8
Merge branch 'canary' into canary
jscyo Nov 11, 2021
41142e4
Merge branch 'canary' into canary
jscyo Nov 11, 2021
4fa2dcf
Merge branch 'canary' into canary
jscyo Nov 11, 2021
f884d9d
Merge branch 'canary' into canary
rishabhpoddar Nov 12, 2021
ce0970c
fixes node init issue race condition
super-tokens Dec 14, 2021
3b3a01e
removes unnecessary file
super-tokens Dec 14, 2021
fd8f57f
Merge pull request #4 from supertokens/fixes-node-init-issue
rishabhpoddar Dec 21, 2021
0256ca8
Merge pull request #1 from rishabhpoddar/canary
rishabhpoddar Dec 21, 2021
ce09b5e
updates supertokens-auth-react dependency
super-tokens Jan 17, 2022
cc6be6f
Merge branch 'canary' into canary
rishabhpoddar Jan 17, 2022
8e8572d
Merge branch 'canary' into canary
rishabhpoddar Jan 17, 2022
a3dadaa
Merge branch 'canary' into canary
rishabhpoddar Jan 17, 2022
afa8606
Merge branch 'canary' into canary
rishabhpoddar Jan 17, 2022
46f0212
updates superttokens-node dependency
super-tokens Feb 22, 2022
e8d50d2
Merge branch 'canary' of https://github.com/supertokens/next.js into …
super-tokens Feb 22, 2022
43d3181
Merge branch 'canary' into canary
rishabhpoddar Feb 22, 2022
72888f1
adds a cap to react dependency
super-tokens Feb 22, 2022
82a171f
updates eslint-config-next version
super-tokens Feb 22, 2022
44152f1
removes unnecessary dev dependency
super-tokens Feb 22, 2022
fd17695
Merge branch 'canary' into canary
rishabhpoddar Feb 22, 2022
48f7e03
Merge branch 'canary' into canary
rishabhpoddar Feb 22, 2022
7e09d8b
updates to latest version of supertokens-auth-react SDK
super-tokens Mar 3, 2022
4bbe9f0
Merge branch 'canary' into canary
rishabhpoddar Mar 3, 2022
d8978d7
Updated nextjs in supertokens example
Apr 7, 2022
3834a2a
Update examples/with-supertokens/package.json
rishabhpoddar Apr 7, 2022
a0cfddb
Update examples/with-supertokens/package.json
rishabhpoddar Apr 7, 2022
67f1db7
Merge pull request #3 from supertokens/updated_st_example
rishabhpoddar Apr 7, 2022
cf140f2
Merge branch 'canary' into canary
rishabhpoddar Apr 8, 2022
f4508e7
Update package.json
rishabhpoddar Apr 8, 2022
5994988
Merge branch 'canary' into canary
rishabhpoddar Apr 8, 2022
66c16d7
Update examples/with-supertokens/package.json
rishabhpoddar Apr 11, 2022
55bd67c
Update examples/with-supertokens/package.json
rishabhpoddar Apr 11, 2022
3a34c03
Merge branch 'canary' into canary
rishabhpoddar Apr 11, 2022
c6fd5e1
updates to supertokens-auth-react version
rishabhpoddar May 14, 2022
7246da6
Merge branch 'canary' into canary
rishabhpoddar May 14, 2022
7762a31
Merge branch 'canary' into canary
rishabhpoddar May 15, 2022
a6a687d
feat: update&improve ssr in with-supertokens
porcellus Jul 4, 2022
f347275
refactor: implement review feedback
porcellus Jul 4, 2022
e14f91e
refactor: moved everything into ProtectedPage to make Auth component …
porcellus Jul 4, 2022
30ecda5
refactor: implement review feedback
porcellus Jul 4, 2022
703f868
updates dependency version and uses nextjs router for navigation
rishabhpoddar Jul 6, 2022
5e1beb1
Merge pull request #4 from supertokens/ssr_improvements
rishabhpoddar Jul 6, 2022
82dabc2
Merge branch 'canary' into canary
rishabhpoddar Jul 6, 2022
94708bd
removes prettier dendency in with-supertokens example app
rishabhpoddar Jul 6, 2022
e519733
Merge branch 'canary' into canary
rishabhpoddar Jul 6, 2022
b9bdaa3
Merge branch 'canary' into canary
rishabhpoddar Jul 6, 2022
e2fbb16
Merge branch 'canary' into canary
rishabhpoddar Jul 6, 2022
8f59d24
docs(examples): updated supertokens example
porcellus Sep 6, 2022
c389226
Merge remote-tracking branch 'upstream/canary' into canary
porcellus Sep 9, 2022
7c8f285
Merge remote-tracking branch 'origin/canary' into examples/supertoken…
porcellus Sep 9, 2022
4beb328
Merge pull request #5 from supertokens/examples/supertokens/session_c…
rishabhpoddar Sep 20, 2022
6a2eac4
updates dependencies versions
rishabhpoddar Sep 20, 2022
39adbce
Merge branch 'canary' into canary
rishabhpoddar Sep 20, 2022
897d161
Merge branch 'canary' into canary
rishabhpoddar Sep 21, 2022
11b1f8e
Merge branch 'canary' into canary
rishabhpoddar Sep 21, 2022
afb8064
fixes linting
rishabhpoddar Sep 21, 2022
7ea96fb
Merge branch 'canary' of https://github.com/supertokens/next.js into …
rishabhpoddar Sep 21, 2022
49d8bec
updates dependency version
rishabhpoddar Oct 25, 2022
3935eac
Merge branch 'canary' into canary
rishabhpoddar Oct 25, 2022
f4d2c7e
Merge branch 'canary' into canary
rishabhpoddar Oct 26, 2022
cac0510
fixes issue with infinite redirect for unauthorised error
rishabhpoddar Nov 8, 2022
bd033ea
Merge branch 'canary' of https://github.com/supertokens/next.js into …
rishabhpoddar Nov 8, 2022
23d78a7
Merge branch 'canary' into canary
rishabhpoddar Nov 8, 2022
da2b7c2
updates use of getSession in SSR
rishabhpoddar Nov 22, 2022
e93790d
Merge branch 'canary' into canary
rishabhpoddar Nov 22, 2022
261b413
fixes redirection loop
rishabhpoddar Nov 25, 2022
97568b8
Merge branch 'canary' into canary
rishabhpoddar Nov 25, 2022
7ded6a8
chore: update supertokens-auth-react version
Dec 15, 2022
e03a32b
Merge pull request #6 from supertokens/chore/update-st-auth-react
rishabhpoddar Dec 15, 2022
4e3355b
Merge branch 'canary' into canary
rishabhpoddar Dec 15, 2022
a741fbd
chore: update st-auth-react version
Jan 6, 2023
631dcae
Merge pull request #7 from supertokens/chore/update-st-auth-react-ver…
rishabhpoddar Jan 6, 2023
c1e874b
Merge branch 'canary' into canary
rishabhpoddar Jan 6, 2023
aa68396
fix: dynamic import issue in examples
Jan 20, 2023
78ae291
Merge pull request #8 from supertokens/fix/dynamic-import-issue
rishabhpoddar Jan 21, 2023
505d6ac
update auth-react version in example app
Jan 24, 2023
42c8398
Merge pull request #9 from supertokens/chore/update-auth-react-version
rishabhpoddar Jan 24, 2023
07b4551
Merge branch 'canary' into canary
rishabhpoddar Jan 24, 2023
e84404c
fix linting issue
Jan 25, 2023
78c9a8f
Merge pull request #10 from supertokens/fix/linting-error
rishabhpoddar Jan 25, 2023
0aad8bd
Merge branch 'canary' into canary
rishabhpoddar Jan 25, 2023
284f8f5
chore:update st-auth-react & node version
Feb 16, 2023
21824dc
Merge pull request #11 from supertokens/chore/update-st-version
rishabhpoddar Feb 16, 2023
70e77ef
Merge branch 'canary' into canary
rishabhpoddar Feb 16, 2023
a61dace
Update example app
nkshah2 Mar 23, 2023
9606372
Merge pull request #12 from supertokens/example-app-update
rishabhpoddar Mar 23, 2023
d758cf2
Merge branch 'canary' into canary
rishabhpoddar Mar 23, 2023
9682ef2
lint fix
rishabhpoddar Mar 24, 2023
90064af
Merge branch 'canary' into canary
rishabhpoddar Mar 24, 2023
67dd145
adds supertokens-web-js depenency in with-supertokens example
rishabhpoddar Mar 30, 2023
f8f5064
Merge branch 'canary' into canary
rishabhpoddar Mar 30, 2023
1a2668b
Merge branch 'canary' into canary
rishabhpoddar Mar 31, 2023
235a723
updated st-node version
May 12, 2023
57b6b17
use latest
May 15, 2023
ab467b6
Merge pull request #13 from supertokens/chore/jwt-rework
rishabhpoddar May 15, 2023
40a01a1
Merge branch 'canary' into canary
rishabhpoddar May 15, 2023
e0d8a90
feat: update supertokens example to new version
porcellus Jul 31, 2023
fb6fb35
Merge pull request #14 from supertokens/feat/update_supertokens
rishabhpoddar Aug 1, 2023
b942c0a
fixes types issue
rishabhpoddar Aug 1, 2023
5af952b
fix: improve typing and styles of with-supertokens
porcellus Aug 1, 2023
9b46927
Merge branch 'canary' into feat/update_supertokens
rishabhpoddar Aug 1, 2023
492cc54
Merge pull request #15 from supertokens/feat/update_supertokens
rishabhpoddar Aug 1, 2023
cf0d972
Merge branch 'canary' into canary
rishabhpoddar Aug 1, 2023
43e0c17
Merge branch 'canary' into canary
rishabhpoddar Aug 7, 2023
017eed8
Merge branch 'canary' into canary
rishabhpoddar Aug 14, 2023
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
51 changes: 36 additions & 15 deletions examples/with-supertokens/config/backendConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,43 @@ export let backendConfig = (): AuthConfig => {
providers: [
// We have provided you with development keys which you can use for testing.
// IMPORTANT: Please replace them with your own OAuth keys for production use.
ThirdPartyEmailPasswordNode.Google({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
ThirdPartyEmailPasswordNode.Github({
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
}),
ThirdPartyEmailPasswordNode.Apple({
clientId: process.env.APPLE_CLIENT_ID,
clientSecret: {
keyId: process.env.APPLE_KEY_ID,
privateKey: process.env.APPLE_PRIVATE_KEY.replace(/\\n/g, '\n'),
teamId: process.env.APPLE_TEAM_ID,
{
config: {
thirdPartyId: "google",
clients: [
{
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
},
],
},
}),
},
{
config: {
thirdPartyId: "github",
clients: [
{
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
},
],
},
},
{
config: {
thirdPartyId: "apple",
clients: [
{
clientId: process.env.APPLE_CLIENT_ID,
additionalConfig: {
keyId: process.env.APPLE_KEY_ID,
privateKey: process.env.APPLE_PRIVATE_KEY.replace(/\\n/g, "\n"),
teamId: process.env.APPLE_TEAM_ID,
},
},
],
},
},
],
}),
SessionNode.init(),
Expand Down
12 changes: 6 additions & 6 deletions examples/with-supertokens/pages/auth/[[...path]].tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Head from 'next/head'
import React, { useEffect } from 'react'
import React, { ComponentType, useEffect } from 'react'
import styles from '../../styles/Home.module.css'
import dynamic from 'next/dynamic'
import SuperTokens from 'supertokens-auth-react'
import { canHandleRoute, getRoutingComponent } from 'supertokens-auth-react/ui'
import { redirectToAuth } from 'supertokens-auth-react'
import { ThirdPartyEmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/thirdpartyemailpassword/prebuiltui";
import { EmailVerificationPreBuiltUI } from "supertokens-auth-react/recipe/emailverification/prebuiltui";

const SuperTokensComponentNoSSR = dynamic<
React.ComponentProps<typeof SuperTokens.getRoutingComponent>
>(new Promise((res) => res(SuperTokens.getRoutingComponent)), { ssr: false })
const SuperTokensComponentNoSSR = dynamic<{}>(new Promise((res) => res(() => getRoutingComponent([ThirdPartyEmailPasswordPreBuiltUI, EmailVerificationPreBuiltUI]))), { ssr: false })

export default function Auth(): JSX.Element {
useEffect(() => {
if (SuperTokens.canHandleRoute() === false) {
if (canHandleRoute([ThirdPartyEmailPasswordPreBuiltUI, EmailVerificationPreBuiltUI]) === false) {
redirectToAuth({
redirectBack: false,
})
Expand Down
11 changes: 7 additions & 4 deletions examples/with-supertokens/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,9 @@ function ProtectedPage({ userId }) {
<p className={styles.description}>
You are authenticated with SuperTokens!
</p>

<p className={styles.description}>
UserId: {session.userId} <br /> (from SSR: {userId})
</p>
<p className={styles.description}>
Access token payload: {JSON.stringify(session.accessTokenPayload)}
</p>
<div
style={{
display: 'flex',
Expand Down Expand Up @@ -134,6 +130,13 @@ function ProtectedPage({ userId }) {
</div>
</div>

<p className={styles.description}>
Access token payload:
<pre className={styles.code}>
{JSON.stringify(session.accessTokenPayload, null, 2)}
</pre>
</p>

<div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}>
<h3>Documentation &rarr;</h3>
Expand Down
2 changes: 2 additions & 0 deletions examples/with-supertokens/styles/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
flex-direction: column;
justify-content: center;
align-items: center;
max-width: 100vw;
}

.footer {
Expand Down Expand Up @@ -69,6 +70,7 @@
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
text-align: left;
}

.grid {
Expand Down