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

Override URL /api/auth/session when use JWT for session - improve performance. #1478

Closed
meotimdihia opened this issue Mar 8, 2021 · 4 comments
Labels
enhancement New feature or request stale Did not receive any activity for 60 days wontfix This will not be worked on

Comments

@meotimdihia
Copy link

meotimdihia commented Mar 8, 2021

Summary of proposed feature

Override URL /api/auth/session when use JWT for session. For example:
My website: https://example.com is deployed on Vercel.
And I want to verify JWT session on URL: https://a.example.com/api/auth/session - use Cloudflare Worker

Purpose of proposed feature

This may be saved for users 200-400ms using Cloudflare Worker to verifying JWT - if their location is too far deployed server.

Related with:
API is slow when deploying to Vercel
#1432
vercel/next.js#22753

Use Cloudflare for Next-auth
#725 (comment)
As @iaincollins said, I want to use Cloudflare workers to read and validate a JWT. Currently, I used Cloudflare Workers for 2 APIs in my websites.

Detail about proposed feature

I checked this problem was implemented on auth0: https://github.com/auth0/nextjs-auth0/blob/c485044/src/frontend/use-user.tsx#L136

Potential problems

No.

Describe any alternatives you've considered

No.

Additional context

No.

Please indicate if you are willing and able to help implement the proposed feature.

I am using next-auth in my prod website.

@balazsorban44
Copy link
Member

balazsorban44 commented Mar 16, 2021

Hi there, I was curious, is the performance hit occurring when you try to use getSession inside getServerSideProps?

@meotimdihia
Copy link
Author

Hi, I don't test pages that used getServerSideProps yet because getServerSideProps is slow and it always requests to deployed the server first. But I don't think getSession affects performance when the request directs to the server in this case.

@stale
Copy link

stale bot commented May 16, 2021

Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks!

@stale stale bot added the stale Did not receive any activity for 60 days label May 16, 2021
@balazsorban44
Copy link
Member

I think this is out of scope for now. We may revisit this in the future.

@balazsorban44 balazsorban44 added the wontfix This will not be worked on label May 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Did not receive any activity for 60 days wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants