Skip to content

Commit

Permalink
Update middleware.js
Browse files Browse the repository at this point in the history
Co-authored-by: Netanel Gilad <netanelg@wix.com>
  • Loading branch information
RonenSivak and netanelgilad committed May 19, 2024
1 parent 9700d96 commit 55b1aa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function middleware(request) {
// This method generates a set of tokens for the visitor.
const visitorTokens = await myWixClient.auth.generateVisitorTokens();

// We store the tokens in a cookie named "session".
// We store the tokens in a cookie named "session" in the request object so the cookie would propagate to our pages / routes
request.cookies.set("session", JSON.stringify(visitorTokens));

// We create a new response using the NextResponse.next method.
Expand Down

0 comments on commit 55b1aa1

Please sign in to comment.