Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/huge-walls-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@faustwp/core': patch
---

#2181 - Sanitize URL in cookie key to make it RFC 6265 sec 4.1.1 compliant.
5 changes: 4 additions & 1 deletion packages/faustwp-core/src/server/auth/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export class OAuth {

constructor(cookies: Cookies) {
this.cookies = cookies;
this.tokenKey = `${getWpUrl()}-rt`;
this.tokenKey = `${getWpUrl().replace(
/[^!#$%&'*+\-.^_`|~0-9A-Za-z]/g,
'',
)}-rt`; // Sanitize URL to make cookie key RFC 6265 sec 4.1.1 compliant.
}

public getRefreshToken(): string | undefined {
Expand Down
Loading