Skip to content

Open-source status page, incident response and uptime monitoring

fix: password protected feed route (#1553)

Maximilian Kasked2ca4923f6ad
diff --git a/apps/docs/src/content/docs/reference/status-page.mdx b/apps/docs/src/content/docs/reference/status-page.mdx
index 3ef5f2cdf..4878ebb48 100644
--- a/apps/docs/src/content/docs/reference/status-page.mdx
+++ b/apps/docs/src/content/docs/reference/status-page.mdx
@@ -16,7 +16,12 @@ You can configure a custom domain for your status page. e.g `status.example.com`
### Password
-You can add a password for your status page.
+You can add a password for your status page to protect a status page. If you are not authenticated, you will get redirected to the `/protected`.
+
+The password is stored in plain text in a `cookie`, so keep the password easy and fun. You can share any page by appending the password via the `pw` search param like: `https://custom.stpg.dev/?pw=my-secret-password` and we will automatically authenticate the user. This can be useful to authenticate to private RSS feeds.
+
+> If you need an email confirmed status page, e.g. by whitelisting domains for specific partners who would access the page with a magic link, please contact [email protected] - we have that on our backlog and are happy to prioritze it.
+
### Favicon
diff --git a/apps/status-page/src/app/(status-page)/[domain]/(public)/feed/[type]/route.ts b/apps/status-page/src/app/(status-page)/[domain]/(public)/feed/[type]/route.ts
index ec2ae9d97..394ca46f8 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/(public)/feed/[type]/route.ts
+++ b/apps/status-page/src/app/(status-page)/[domain]/(public)/feed/[type]/route.ts
@@ -25,7 +25,12 @@ export async function GET(
trpc.page.getPageBySlug.queryOptions({ slug: domain }),
);
if (!page) return notFound();
- if (page.passwordProtected) return unauthorized();
+
+ if (page.passwordProtected) {
+ const url = new URL(_request.url);
+ const password = url.searchParams.get("pw");
+ if (password !== page.password) return unauthorized();
+ }
const baseUrl = getBaseUrl({
slug: page.slug,