From cc2a0539cca321d50de37197149dcb128bde2bcd Mon Sep 17 00:00:00 2001 From: Musa Kaleem <131704022+Musa-Kal@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:16:59 -0500 Subject: [PATCH 1/2] sign in with Google, and a privacy link on sign in and the landing page Production gets the Google provider (client id in config.toml, secret from the GitHub production environment) and the google_auth flag turns on in a migration; seed.sql keeps it off locally, where there is no provider. Email confirmation stays on: seats and email-bound invites trust a confirmed address, and the security and deployment docs now say so. The sign-up privacy note becomes a shared PrivacyNote, shown on sign in too, and the landing footer links the privacy page. Co-authored-by: Ferrin <177692050+Ferrin-Y@users.noreply.github.com> Co-authored-by: noorelmosrati <182049385+noorelmosrati@users.noreply.github.com> --- apps/web/src/features/auth/auth-parts.tsx | 19 ++++++++++++++ .../src/features/auth/sign-in-page.test.tsx | 11 ++++++++ apps/web/src/features/auth/sign-in-page.tsx | 25 +++++++++++-------- apps/web/src/features/auth/sign-up-page.tsx | 17 ++----------- apps/web/src/features/shell/landing-page.tsx | 10 ++++++++ docs/deployment.md | 3 ++- docs/launch-checklist.md | 6 +++-- docs/security.md | 2 +- docs/splitwise-parity.md | 2 +- packages/i18n/src/de/shell.ts | 1 + packages/i18n/src/en/shell.ts | 1 + packages/i18n/src/es/shell.ts | 1 + packages/i18n/src/fr/shell.ts | 1 + packages/i18n/src/pt/shell.ts | 1 + supabase/config.toml | 6 +++++ .../20261116230000_google_sign_in_on.sql | 3 +++ supabase/seed.sql | 4 +++ 17 files changed, 82 insertions(+), 31 deletions(-) create mode 100644 supabase/migrations/20261116230000_google_sign_in_on.sql diff --git a/apps/web/src/features/auth/auth-parts.tsx b/apps/web/src/features/auth/auth-parts.tsx index 81f15e11..2f9f19c6 100644 --- a/apps/web/src/features/auth/auth-parts.tsx +++ b/apps/web/src/features/auth/auth-parts.tsx @@ -4,7 +4,9 @@ import { Button, IconButton, Input, toast, type InputProps } from '@potluck/ui' import { useQuery } from '@tanstack/react-query' import { Eye, EyeOff } from 'lucide-react' import { forwardRef, useState } from 'react' +import { HELP_PAGES } from '@/features/help/topics' import { authCallbackUrl } from '@/lib/auth' +import { docsUrl } from '@/lib/docs' import { errorMessage } from '@/lib/errors' import { supabase } from '@/lib/supabase' @@ -135,3 +137,20 @@ export function CheckEmail({ ) } + +/** Potluck has no separate terms: the guide's privacy page says what is kept and who sees it. */ +export function PrivacyNote() { + return ( +
+ {t('auth.signUp.privacy')}{' '} + + {t('auth.signUp.privacyLink')} ({t('help.newTab')}) + +
+ ) +} diff --git a/apps/web/src/features/auth/sign-in-page.test.tsx b/apps/web/src/features/auth/sign-in-page.test.tsx index ed26f4d7..d0423e47 100644 --- a/apps/web/src/features/auth/sign-in-page.test.tsx +++ b/apps/web/src/features/auth/sign-in-page.test.tsx @@ -2,7 +2,9 @@ import { t } from '@potluck/i18n' import { Toaster } from '@potluck/ui' import { act, fireEvent, screen, waitFor } from '@testing-library/react' import { beforeEach, describe, expect, it, vi } from 'vitest' +import { HELP_PAGES } from '@/features/help/topics' import { confirmSession, endEndedSession } from '@/lib/auth' +import { docsUrl } from '@/lib/docs' import { renderWithProviders } from '@/test/render' import { authCallsTo, resetDb, respondAuth } from '@/test/supabase' import { SignInPage } from './sign-in-page' @@ -73,6 +75,15 @@ describe('SignInPage', () => { expect(await screen.findByText(t('auth.signIn.sessionEnded'))).toBeInTheDocument() }) + it("links to the guide's privacy page in a new tab", async () => { + renderPage() + const link = await screen.findByRole('link', { + name: `${t('auth.signUp.privacyLink')} (${t('help.newTab')})`, + }) + expect(link).toHaveAttribute('href', docsUrl(HELP_PAGES.privacy)) + expect(link).toHaveAttribute('target', '_blank') + }) + it('never redirects off site after signing in', async () => { const { router } = renderPage({ redirect: 'https://evil.example' }) await fill('ava@example.test', 'hunter22') diff --git a/apps/web/src/features/auth/sign-in-page.tsx b/apps/web/src/features/auth/sign-in-page.tsx index c6beb470..06502a46 100644 --- a/apps/web/src/features/auth/sign-in-page.tsx +++ b/apps/web/src/features/auth/sign-in-page.tsx @@ -13,7 +13,7 @@ import { errorMessage } from '@/lib/errors' import { detectTimezone } from '@/lib/locale' import { supabase } from '@/lib/supabase' import { AuthLayout } from './auth-layout' -import { CheckEmail, OAuthButtons, PasswordInput } from './auth-parts' +import { CheckEmail, OAuthButtons, PasswordInput, PrivacyNote } from './auth-parts' export interface AuthPageProps { redirect?: string @@ -86,16 +86,19 @@ export function SignInPage({ redirect, notice }: AuthPageProps) { subtitle={t('auth.signIn.subtitle')} notice={notice ?? (ended ? t('auth.signIn.sessionEnded') : undefined)} footer={ -- {t('auth.signIn.noAccount')}{' '} - - {t('auth.signIn.createAccount')} - -
++ {t('auth.signIn.noAccount')}{' '} + + {t('auth.signIn.createAccount')} + +
+- {t('auth.signUp.privacy')}{' '} - - {t('auth.signUp.privacyLink')} ({t('help.newTab')}) - -
+