From d23ab627ba9ada3ef81c1849224c5662986c493e Mon Sep 17 00:00:00 2001 From: Steven Le Date: Thu, 30 May 2024 12:49:29 -0700 Subject: [PATCH] fix: fix password protect cookie name --- .changeset/slow-eels-tease.md | 5 +++++ examples/blog/root.config.ts | 4 ++-- packages/root-password-protect/src/plugin/plugin.tsx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/slow-eels-tease.md diff --git a/.changeset/slow-eels-tease.md b/.changeset/slow-eels-tease.md new file mode 100644 index 00000000..3a4f30b9 --- /dev/null +++ b/.changeset/slow-eels-tease.md @@ -0,0 +1,5 @@ +--- +'@blinkk/root-password-protect': patch +--- + +fix: fix password protect cookie name diff --git a/examples/blog/root.config.ts b/examples/blog/root.config.ts index 01d5774f..6b530cda 100644 --- a/examples/blog/root.config.ts +++ b/examples/blog/root.config.ts @@ -76,8 +76,8 @@ export default defineConfig({ source: '/protected/**', // Generated by: `root-password-protect generate-hash "..."`. password: { - hash: '0f1189fcf0e520662a2720f63befbe25b05722a9f9527bbe607428ecde5c0ee736ca3061e692603330c2d022432ca00ac28ddf8c6031dacfb12be64c335d6b0b', - salt: '7184f0c69d7607317589f47c2442ff20', + hash: '65c933288e2d8c81476add7cc77285c7a3b095a040a2392e0cc79512e8f372124e6c84cea745d70e93bcf147dcc565d464fb3f15d0c299ec435027c1be26d809', + salt: '63e8d444544a61642904b1440cdea79e', }, }, ], diff --git a/packages/root-password-protect/src/plugin/plugin.tsx b/packages/root-password-protect/src/plugin/plugin.tsx index 82f3ac03..d451e7f7 100644 --- a/packages/root-password-protect/src/plugin/plugin.tsx +++ b/packages/root-password-protect/src/plugin/plugin.tsx @@ -10,7 +10,7 @@ import {generateNonce, setSecurityHeaders} from '../core/csp.js'; import {hashPassword, verifyPassword} from '../core/password.js'; const SESSION_COOKIE_HASH = 'password_protect.hash'; -const SESSION_COOKIE_SALT = 'password_protect.hash'; +const SESSION_COOKIE_SALT = 'password_protect.salt'; export interface PasswordProtectedRoute { /**