Skip to content

Commit

Permalink
Use strict-origin referrer policy (#1614)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowOnPaper committed Jun 25, 2024
1 parent c17c024 commit 435c0af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ app.get("email-verification/:token", async () => {
headers: {
Location: "/",
"Set-Cookie": sessionCookie.serialize(),
"Referrer-Policy": "no-referrer"
"Referrer-Policy": "strict-origin"
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/guides/email-and-password/password-reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ Make sure to implement rate limiting based on IP addresses.

## Verify token

Make sure to set the `Referrer-Policy` header of the password reset page to `no-referrer` to protect the token from referrer leakage.
Make sure to set the `Referrer-Policy` header of the password reset page to `strict-origin` to protect the token from referrer leakage.

```ts
app.get("/reset-password/:token", async () => {
// ...
return new Response(html, {
headers: {
"Referrer-Policy": "no-referrer"
"Referrer-Policy": "strict-origin"
}
});
});
Expand Down Expand Up @@ -137,7 +137,7 @@ app.post("/reset-password/:token", async () => {
headers: {
Location: "/",
"Set-Cookie": sessionCookie.serialize(),
"Referrer-Policy": "no-referrer"
"Referrer-Policy": "strict-origin"
}
});
});
Expand Down

0 comments on commit 435c0af

Please sign in to comment.