Skip to content

Commit 750bfce

Browse files
committed
fix: remove query params from url path check
1 parent c5f8ff3 commit 750bfce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/slimy-beans-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@blinkk/root-cms': patch
3+
---
4+
5+
fix: remove query params from url path check

packages/root-cms/core/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export function cmsPlugin(options: CMSPluginOptions): CMSPlugin {
212212
* the URL path starts with /cms or if ?preview=true is in the URL.
213213
*/
214214
function loginRequired(req: Request): boolean {
215-
const urlPath = String(req.originalUrl).toLowerCase();
215+
const urlPath = String(req.originalUrl).split('?')[0].toLowerCase();
216216
// Allow the cron to run unauthenticated. The cron job is responsible
217217
// for saving version history.
218218
if (urlPath === '/cms/api/cron.run') {

0 commit comments

Comments
 (0)