Skip to content

fix(auth): scope signup security settings to cloud#3100

Merged
HarshMN2345 merged 3 commits into
mainfrom
fix-email-policies-cloud-only
Jul 1, 2026
Merged

fix(auth): scope signup security settings to cloud#3100
HarshMN2345 merged 3 commits into
mainfrom
fix-email-policies-cloud-only

Conversation

@HarshMN2345

@HarshMN2345 HarshMN2345 commented Jul 1, 2026

Copy link
Copy Markdown
Member

No description provided.

@HarshMN2345 HarshMN2345 changed the title fix(auth): hide email policies on self-hosted fix(auth): scope signup security settings to cloud Jul 1, 2026
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR scopes two cloud-only features behind isCloud guards: the signup email security settings panel (now hidden on self-hosted) and the payments page (now redirects non-cloud users). It also fixes a TypeError in containerButton.svelte by adding optional chaining to billingPlanDetails access in both branches of the tooltip ternary.

  • auth/security/+page.svelte: UpdateSignupEmailSecurity is wrapped in {#if isCloud}, preventing it from rendering on self-hosted instances.
  • account/payments/+page.ts: Adds an early redirect(302, '/') guard so non-cloud users can't access the payments page.
  • containerButton.svelte: Adds ?. to both billingPlanDetails?.group and billingPlanDetails?.name, resolving the previously flagged null-access risk.

Confidence Score: 5/5

Safe to merge — the three changes are small, well-scoped, and consistent with existing patterns in the codebase.

All three changes are straightforward: optional chaining additions and isCloud conditional guards. The redirect target inconsistency in the payments guard only matters if the app is deployed at a non-root base path, which is an unlikely concern in practice.

src/routes/(console)/account/payments/+page.ts — the redirect target could be aligned with the resolve('/') pattern used elsewhere.

Important Files Changed

Filename Overview
src/lib/layout/containerButton.svelte Adds optional chaining for both billingPlanDetails?.group and billingPlanDetails?.name, addressing the previously flagged TypeError risk in both branches of the ternary.
src/routes/(console)/account/payments/+page.ts Adds an isCloud guard that redirects non-cloud users away from the payments page. The redirect(302, '/') call is correct for SvelteKit 2 but uses a bare '/' instead of resolve('/') from $app/paths as done in other load files.
src/routes/(console)/project-[region]-[project]/auth/security/+page.svelte Wraps UpdateSignupEmailSecurity in an {#if isCloud} block so the component only renders on cloud deployments — straightforward and correct.

Reviews (3): Last reviewed commit: "fix: add missing optional chain on billi..." | Re-trigger Greptile

@HarshMN2345 HarshMN2345 requested a review from ChiragAgg5k July 1, 2026 04:43
@HarshMN2345 HarshMN2345 merged commit cb3af0c into main Jul 1, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-email-policies-cloud-only branch July 1, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants