-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Prep for release #40
Merged
Merged
Prep for release #40
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The way Next.js works--with all its optimizations--doesn't allow to have a token on the first render, we could do it with SSR, but that would compromise the home page. Maybe doing it in a login page would be ideal. We can't access the cookie from the client because it's saved in an httpOnly cookie. For this reason, we can't do Double-submit cookie pattern since we can't get the token from the cookie to add it to the header. Again, we could add it with `getInitialProps` but we compromise important optimizations. So far, we are able to do Synchronizer Token Pattern and with the caveat of doing a `/csrf` endpoint, the thing that the Understanding CSRF document suggest against.
The example now uses a SSR page to setup the token instead of calling a API route. Lock files are now in the .gitignore file.
Update functionality, docs, and bug fixes
Next.js maintainers recommend to use e2e for testing endpoints, to run a Next.js app instance and send a request against the API route directly. * vercel/next.js#15166 (reply in thread) For running the webserver and running the e2e I decided to use Playwright. Also added yalc for managing local next-csrf as a dependency locally in the example folder.
j0lvera
force-pushed
the
setup-integration-testing
branch
from
April 22, 2022 13:42
74c1711
to
0cbd07e
Compare
j0lvera
force-pushed
the
setup-integration-testing
branch
from
April 22, 2022 14:06
d929204
to
5946f98
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a bunch of bugs. Adds a new example, and add some API documentation.
Also, adds an initial setup for integration and unit tests.