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

With Supertokens example #21384

Merged
merged 9 commits into from
Feb 15, 2021
Merged

With Supertokens example #21384

merged 9 commits into from
Feb 15, 2021

Conversation

rishabhpoddar
Copy link
Contributor

Hey,

SuperTokens is a new open source Auth framework (alternative to Auth0, Firebase auth etc..).

At the moment, we offer:

  • Secure sessions (httpOnly cookies, access / rotating refresh tokens, anti-csrf etc)
  • Email password auth with sign in, sign up UI, reset password and email verification flow
  • Social login (coming soon).

Due to an increase in the number of users using SuperTokens with Next.JS, we thought it would be best to issue this PR.

Thanks! Happy to answer any questions :)

@ijjk ijjk added the examples Issue/PR related to examples label Jan 20, 2021
@ijjk
Copy link
Member

ijjk commented Jan 20, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary supertokens/next.js with-supertokens Change
buildDuration 8.9s 8.8s -89ms
nodeModulesSize 73.3 MB 73.3 MB
Page Load Tests Overall increase ✓
vercel/next.js canary supertokens/next.js with-supertokens Change
/ failed reqs 0 0
/ total time (seconds) 1.711 1.766 ⚠️ +0.05
/ avg req/sec 1461.36 1415.36 ⚠️ -46
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.093 1.067 -0.03
/error-in-render avg req/sec 2286.6 2341.96 +55.36
Client Bundles (main, webpack, commons)
vercel/next.js canary supertokens/next.js with-supertokens Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary supertokens/next.js with-supertokens Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary supertokens/next.js with-supertokens Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary supertokens/next.js with-supertokens Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary supertokens/next.js with-supertokens Change
index.html gzip 616 B 616 B
link.html gzip 621 B 621 B
withRouter.html gzip 609 B 609 B
Overall change 1.85 kB 1.85 kB

Serverless Mode
General
vercel/next.js canary supertokens/next.js with-supertokens Change
buildDuration 10.5s 10.5s ⚠️ +30ms
nodeModulesSize 73.3 MB 73.3 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary supertokens/next.js with-supertokens Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary supertokens/next.js with-supertokens Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary supertokens/next.js with-supertokens Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary supertokens/next.js with-supertokens Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary supertokens/next.js with-supertokens Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.19 MB 5.19 MB

Webpack 5 Mode (Increase detected ⚠️)
General
vercel/next.js canary supertokens/next.js with-supertokens Change
buildDuration 10.8s 10.7s -98ms
nodeModulesSize 73.3 MB 73.3 MB
Page Load Tests Overall increase ✓
vercel/next.js canary supertokens/next.js with-supertokens Change
/ failed reqs 0 0
/ total time (seconds) 1.749 1.705 -0.04
/ avg req/sec 1429.74 1465.87 +36.13
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.088 1.102 ⚠️ +0.01
/error-in-render avg req/sec 2298.61 2267.85 ⚠️ -30.76
Client Bundles (main, webpack, commons)
vercel/next.js canary supertokens/next.js with-supertokens Change
597-3bd7d6bd..868b.js gzip 13 kB 13 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.58 kB 6.58 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 59.8 kB 59.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary supertokens/next.js with-supertokens Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary supertokens/next.js with-supertokens Change
_app-a5b2e84..33cf.js gzip 1.26 kB 1.26 kB
_error-6f1f9..5577.js gzip 3.38 kB 3.38 kB
hooks-725de8..0a15.js gzip 904 B 904 B
index-939503..6e1c.js gzip 232 B 232 B
link-e0cc871..fdbb.js gzip 1.63 kB 1.63 kB
routerDirect..9360.js gzip 308 B 308 B
withRouter-6..44ec.js gzip 304 B 304 B
Overall change 8.02 kB 8.02 kB
Client Build Manifests
vercel/next.js canary supertokens/next.js with-supertokens Change
_buildManifest.js gzip 299 B 299 B
Overall change 299 B 299 B
Rendered Page Sizes
vercel/next.js canary supertokens/next.js with-supertokens Change
index.html gzip 585 B 585 B
link.html gzip 592 B 592 B
withRouter.html gzip 579 B 579 B
Overall change 1.76 kB 1.76 kB

Diffs

Diff for index.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/",
         "query": {},
-        "buildId": "UqRRDXq126mxvfaJZFJER",
+        "buildId": "q6fVSC0AY7XnSEkIJezOs",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/UqRRDXq126mxvfaJZFJER/_buildManifest.js"
+      src="/_next/static/q6fVSC0AY7XnSEkIJezOs/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/UqRRDXq126mxvfaJZFJER/_ssgManifest.js"
+      src="/_next/static/q6fVSC0AY7XnSEkIJezOs/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "UqRRDXq126mxvfaJZFJER",
+        "buildId": "q6fVSC0AY7XnSEkIJezOs",
         "isFallback": false,
         "gip": true
       }
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/UqRRDXq126mxvfaJZFJER/_buildManifest.js"
+      src="/_next/static/q6fVSC0AY7XnSEkIJezOs/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/UqRRDXq126mxvfaJZFJER/_ssgManifest.js"
+      src="/_next/static/q6fVSC0AY7XnSEkIJezOs/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "UqRRDXq126mxvfaJZFJER",
+        "buildId": "q6fVSC0AY7XnSEkIJezOs",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/UqRRDXq126mxvfaJZFJER/_buildManifest.js"
+      src="/_next/static/q6fVSC0AY7XnSEkIJezOs/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/UqRRDXq126mxvfaJZFJER/_ssgManifest.js"
+      src="/_next/static/q6fVSC0AY7XnSEkIJezOs/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: 37ef0ae

examples/with-supertokens/package.json Outdated Show resolved Hide resolved
examples/with-supertokens/pages/_app.js Outdated Show resolved Hide resolved
examples/with-supertokens/pages/index.js Outdated Show resolved Hide resolved
examples/with-supertokens/supertokens.js Outdated Show resolved Hide resolved
@kant01ne
Copy link
Contributor

kant01ne commented Jan 27, 2021

Hey @leerob ! Thanks for the review!
I've updated the PR to take all your comments into considerations.

That would be really great to get listed in https://github.com/vercel/next.js/blob/canary/docs/authentication.md as well but I wasn't sure if it was for me to decide :) Let me know if I should add the doc update to this PR.

@rishabhpoddar
Copy link
Contributor Author

@leerob is there anything else we can do to make this PR / our integration more helpful for NextJS users? Thanks

Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my slow response here on the follow-up. This looks great! Thank you so much ✅

@leerob leerob merged commit f6e2b06 into vercel:canary Feb 15, 2021
@rishabhpoddar
Copy link
Contributor Author

rishabhpoddar commented Feb 16, 2021

Thank you @leerob. How can we go about updating the docs related to this?

@kant01ne kant01ne deleted the with-supertokens branch February 16, 2021 08:12
@kant01ne
Copy link
Contributor

Thanks for the review @leerob , I created a new PR for the docs update as mentioned above #22223

kodiakhq bot pushed a commit that referenced this pull request Mar 1, 2021
Hey team. This PR is a follow up on #21384 to add a reference to `with-supertokens` example to authentication doc.
This was referenced Mar 8, 2021
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants