-
Notifications
You must be signed in to change notification settings - Fork 413
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
Cookie chunking support #1975
Cookie chunking support #1975
Conversation
…er tests related to await expect
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1975 +/- ##
==========================================
+ Coverage 76.19% 77.57% +1.38%
==========================================
Files 21 21
Lines 1525 1610 +85
Branches 242 259 +17
==========================================
+ Hits 1162 1249 +87
+ Misses 356 354 -2
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Don't get me wrong, I do not want to be pushy, but we're waiting on this to release our SDK v4 implementation. When'll this be merged? |
Hello, looks like this change broke our integration. We are getting v4.2.1 cookies v4.3.0 cookies import { AccessTokenError, AuthorizationCodeGrantError } from "@auth0/nextjs-auth0/errors";
import { NextRequest, NextResponse, type MiddlewareConfig } from "next/server";
export async function middleware(req: NextRequest): Promise<NextResponse> {
const res = await auth0.middleware(req);
if (req.nextUrl.pathname.startsWith("/auth")) {
return res;
}
try {
const { token } = await auth0.getAccessToken(req, res);
if (req.nextUrl.pathname.startsWith("/v1")) {
const url = new URL(...);
url.pathname += req.nextUrl.pathname;
url.search = req.nextUrl.search;
const headers = new Headers(res.headers); // <- this causes problem
headers.set("Authorization", `Bearer ${token}`);
return NextResponse.rewrite(url, { headers }); // <- because the remote server allows up to 5mb
}
return res;
} catch (error) {
// ...
}
} |
For some reason, we get two cookies set that explode size of overall cookies. Why is that? |
What is the total size of your cookies and how many cookies do you have? You are seeing two cookies because we:
|
There are only two cookies and they are both from |
Ok, I'm going to move to #1978 |
Changes
This PR changes the cookie store/retrieve strategy to use cookie chunking on the session cookie.
Also fixed some warnings in some test files.
Write behaviour
__index
.__session
cookie is stored.Read behaviour
Read bhaviour is backwards compatible with
v4.X.X
andv3.X.X
versionsTesting
PASSING