From 86c7bdf39f229aed73175026c1890de4f54dc320 Mon Sep 17 00:00:00 2001 From: Grant Forrest Date: Thu, 13 Jun 2024 20:51:45 -0400 Subject: [PATCH] adopt auth-client library --- apps/gnocchi/hub/package.json | 2 +- apps/gnocchi/web/package.json | 2 +- apps/marginalia/web/package.json | 2 +- apps/star-chart/web/package.json | 2 +- apps/trip-tick/web/package.json | 2 +- apps/wish-wash/web/package.json | 4 +- blog/package.json | 2 +- packages/client/package.json | 2 +- pnpm-lock.yaml | 165 +++++++++++++----- server/package.json | 2 +- server/src/auth/handlers.ts | 1 + web/package.json | 3 +- .../auth/EmailCompleteSignupForm.tsx | 34 ---- web/src/components/auth/EmailSignInForm.tsx | 68 -------- web/src/components/auth/EmailSignupForm.tsx | 82 --------- web/src/components/auth/OAuthSignInButton.tsx | 33 ---- web/src/components/auth/ResetPasswordForm.tsx | 34 ---- web/src/pages/ClaimInvitePage.tsx | 2 +- web/src/pages/LoginPage.tsx | 33 ++-- web/src/pages/ResetPasswordPage.tsx | 9 +- web/src/pages/VerifyPage.tsx | 9 +- 21 files changed, 168 insertions(+), 325 deletions(-) delete mode 100644 web/src/components/auth/EmailCompleteSignupForm.tsx delete mode 100644 web/src/components/auth/EmailSignInForm.tsx delete mode 100644 web/src/components/auth/EmailSignupForm.tsx delete mode 100644 web/src/components/auth/OAuthSignInButton.tsx delete mode 100644 web/src/components/auth/ResetPasswordForm.tsx diff --git a/apps/gnocchi/hub/package.json b/apps/gnocchi/hub/package.json index b4d72db4..e7f544f1 100644 --- a/apps/gnocchi/hub/package.json +++ b/apps/gnocchi/hub/package.json @@ -20,7 +20,7 @@ "typecheck": "tsc --build tsconfig.json" }, "dependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/ui": "^0.8.20", "@a-type/utils": "^1.0.8", "@tiptap/core": "^2.2.4", "@tiptap/extension-document": "^2.2.4", diff --git a/apps/gnocchi/web/package.json b/apps/gnocchi/web/package.json index c8d5c7d1..e32823b4 100644 --- a/apps/gnocchi/web/package.json +++ b/apps/gnocchi/web/package.json @@ -14,7 +14,7 @@ "typecheck": "tsc --build tsconfig.json" }, "dependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/ui": "^0.8.20", "@a-type/utils": "^1.0.8", "@biscuits/client": "workspace:*", "@biscuits/error": "workspace:*", diff --git a/apps/marginalia/web/package.json b/apps/marginalia/web/package.json index da1cfb3d..9a636bde 100644 --- a/apps/marginalia/web/package.json +++ b/apps/marginalia/web/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "@a-type/ui": "0.8.19", + "@a-type/ui": "0.8.20", "@a-type/utils": "1.1.0", "@biscuits/client": "workspace:*", "@marginalia.biscuits/verdant": "workspace:*", diff --git a/apps/star-chart/web/package.json b/apps/star-chart/web/package.json index cd5998c8..76f0958c 100644 --- a/apps/star-chart/web/package.json +++ b/apps/star-chart/web/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "@a-type/ui": "0.8.19", + "@a-type/ui": "0.8.20", "@a-type/utils": "1.1.2", "@biscuits/client": "workspace:*", "@react-spring/web": "^9.7.3", diff --git a/apps/trip-tick/web/package.json b/apps/trip-tick/web/package.json index 1d15ef44..e7666cfc 100644 --- a/apps/trip-tick/web/package.json +++ b/apps/trip-tick/web/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/ui": "^0.8.20", "@a-type/utils": "^1.0.6", "@biscuits/client": "workspace:*", "@radix-ui/react-progress": "^1.0.3", diff --git a/apps/wish-wash/web/package.json b/apps/wish-wash/web/package.json index 0ec09ebe..d812fc9d 100644 --- a/apps/wish-wash/web/package.json +++ b/apps/wish-wash/web/package.json @@ -9,13 +9,13 @@ "preview": "vite preview" }, "dependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/ui": "^0.8.20", "@a-type/utils": "^1.0.8", "@biscuits/client": "workspace:*", "@react-spring/web": "^9.7.3", - "@wish-wash.biscuits/verdant": "workspace:*", "@unocss/transformer-variant-group": "^0.54.1", "@verdant-web/react-router": "^0.6.2", + "@wish-wash.biscuits/verdant": "workspace:*", "react": "18.3.1", "react-dom": "^18.2.0", "react-hot-toast": "^2.4.1", diff --git a/blog/package.json b/blog/package.json index 43304a28..e6817d52 100644 --- a/blog/package.json +++ b/blog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/ui": "^0.8.20", "@astrojs/check": "^0.5.10", "@astrojs/mdx": "^2.3.1", "@astrojs/rss": "^4.0.5", diff --git a/packages/client/package.json b/packages/client/package.json index 300a4f69..ffe77b07 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -56,7 +56,7 @@ "vite-plugin-pwa": "0.19.2" }, "devDependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/ui": "^0.8.20", "@types/react": "18.3.3", "@verdant-web/store": "^3.6.4", "react": "18.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59d478a9..4ce2fc30 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,8 +61,8 @@ importers: apps/gnocchi/hub: dependencies: '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@a-type/utils': specifier: ^1.0.8 version: 1.1.0 @@ -178,13 +178,11 @@ importers: specifier: 18.3.1 version: 18.3.1 - apps/gnocchi/verdant/dist/esm/client: {} - apps/gnocchi/web: dependencies: '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.2)(react-dom@18.3.1)(react@18.3.1) '@a-type/utils': specifier: ^1.0.8 version: 1.0.8 @@ -463,8 +461,8 @@ importers: apps/marginalia/web: dependencies: '@a-type/ui': - specifier: 0.8.19 - version: 0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + specifier: 0.8.20 + version: 0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@a-type/utils': specifier: 1.1.0 version: 1.1.0 @@ -566,8 +564,8 @@ importers: apps/star-chart/web: dependencies: '@a-type/ui': - specifier: 0.8.19 - version: 0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + specifier: 0.8.20 + version: 0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@a-type/utils': specifier: 1.1.2 version: 1.1.2 @@ -696,8 +694,8 @@ importers: apps/trip-tick/web: dependencies: '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.3)(react-dom@18.2.0)(react@18.3.1) '@a-type/utils': specifier: ^1.0.6 version: 1.0.6 @@ -829,8 +827,8 @@ importers: apps/wish-wash/web: dependencies: '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(@types/react-dom@18.3.0)(@types/react@18.3.3)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@a-type/utils': specifier: ^1.0.8 version: 1.1.3 @@ -902,8 +900,8 @@ importers: blog: dependencies: '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(react-dom@18.3.1)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@astrojs/check': specifier: ^0.5.10 version: 0.5.10(prettier@3.2.5)(typescript@5.4.5) @@ -1023,8 +1021,8 @@ importers: version: 1.13.2(@types/react@18.3.3)(react@18.3.1) devDependencies: '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(@types/react@18.3.3)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@types/react': specifier: 18.3.3 version: 18.3.3 @@ -1082,8 +1080,8 @@ importers: server: dependencies: '@a-type/auth': - specifier: 0.6.0 - version: 0.6.0 + specifier: 0.6.5 + version: 0.6.5 '@a-type/utils': specifier: 1.1.3 version: 1.1.3 @@ -1226,9 +1224,12 @@ importers: web: dependencies: + '@a-type/auth-client': + specifier: 1.0.4 + version: 1.0.4(@a-type/ui@0.8.20)(react@18.3.1) '@a-type/ui': - specifier: ^0.8.19 - version: 0.8.19(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + specifier: ^0.8.20 + version: 0.8.20(@types/react-dom@18.3.0)(@types/react@18.3.3)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) '@biscuits/apps': specifier: workspace:* version: link:../packages/apps @@ -1356,8 +1357,18 @@ packages: transitivePeerDependencies: - encoding - /@a-type/auth@0.6.0: - resolution: {integrity: sha512-+1wOQ7qr32d/xuVG5dbNSyatMt/gBHlqWPduAznqn7WauiBI/4ksOr7E2YEH6BtzN0C0YyvbOHlw9NPVsGU4jA==} + /@a-type/auth-client@1.0.4(@a-type/ui@0.8.20)(react@18.3.1): + resolution: {integrity: sha512-SU8hGqNuusvVwbtQ/0shugYhLN6hbpTUmQbLQntj5Bmg9ST5tomzhLzz4ek/+/bdWmnOr4c2Hx5g2eDJl4u0NQ==} + peerDependencies: + '@a-type/ui': ^0.8.0 + react: ^18 + dependencies: + '@a-type/ui': 0.8.20(@types/react-dom@18.3.0)(@types/react@18.3.3)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) + react: 18.3.1 + dev: false + + /@a-type/auth@0.6.5: + resolution: {integrity: sha512-qYqClgdPHjCCkTB8WF3ukF/i3nfRyhLmMAOi39cmfBaPwJxn3H7PAixq6RYWMr4qFZY8oXE9d4EU5TCfQfhnfQ==} dependencies: cookie: 0.6.0 discord-oauth2: 2.12.1 @@ -1382,13 +1393,65 @@ packages: - encoding - supports-color - /@a-type/ui@0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.3.1): - resolution: {integrity: sha512-qAIkj6pqiEA2V7G4zybsklIXO4qS/c79jKrSovBC7K5jipch35RsDORPGPRA2OEpxaGbymGNUVzqWbk5msd8ig==} + /@a-type/ui@0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.2)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-XFwp9ghCqtcLCSyVe7X7ZCMSKqGPBryCJxRUZDS+LSo4gODTSTJjjcMW0k4ZqeO9A/JvvZACO2Sc4FtX1LwPDw==} + peerDependencies: + react: ^18 + react-dom: ^18 + dependencies: + '@a-type/utils': 1.1.0 + '@radix-ui/react-accordion': 1.1.2(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-checkbox': 1.0.4(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-context-menu': 2.1.5(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-dropdown-menu': 2.0.6(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-icons': 1.3.0(react@18.3.1) + '@radix-ui/react-menu': 2.0.6(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-popover': 1.0.7(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-radio-group': 1.1.3(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-select': 2.0.0(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-slider': 1.1.2(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.79)(react@18.3.1) + '@radix-ui/react-switch': 1.0.3(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-tabs': 1.0.4(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-toast': 1.1.5(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-toggle-group': 1.0.4(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-tooltip': 1.0.7(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1) + '@react-spring/web': 9.7.3(react-dom@18.3.1)(react@18.3.1) + '@tiptap/core': 2.4.0(@tiptap/pm@2.4.0) + '@tiptap/extension-document': 2.4.0(@tiptap/core@2.4.0) + '@tiptap/extension-paragraph': 2.4.0(@tiptap/core@2.4.0) + '@tiptap/pm': 2.4.0 + '@tiptap/react': 2.4.0(@tiptap/core@2.4.0)(@tiptap/pm@2.4.0)(react-dom@18.3.1)(react@18.3.1) + '@tiptap/starter-kit': 2.4.0(@tiptap/pm@2.4.0) + '@use-gesture/react': 10.3.1(react@18.3.1) + browser-image-resizer: 2.4.1 + calendar-blocks: 0.3.1(react@18.3.1) + clsx: 2.1.1 + color-interpolate: 1.0.5 + color-parse: 2.0.2 + color-space: 2.0.1 + date-fns: 2.30.0 + formik: 2.4.6(react@18.3.1) + pluralize: 8.0.0 + prosemirror-model: 1.21.1 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-hot-toast: 2.4.1(csstype@3.1.2)(react-dom@18.3.1)(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + - '@types/react-dom' + - csstype + dev: false + + /@a-type/ui@0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.3)(react-dom@18.2.0)(react@18.3.1): + resolution: {integrity: sha512-XFwp9ghCqtcLCSyVe7X7ZCMSKqGPBryCJxRUZDS+LSo4gODTSTJjjcMW0k4ZqeO9A/JvvZACO2Sc4FtX1LwPDw==} peerDependencies: react: ^18 react-dom: ^18 dependencies: - '@a-type/utils': 1.1.3 + '@a-type/utils': 1.1.0 '@radix-ui/react-accordion': 1.1.2(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.3.1) '@radix-ui/react-checkbox': 1.0.4(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.3.1) '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.2.0)(react@18.3.1) @@ -1417,7 +1480,7 @@ packages: '@use-gesture/react': 10.3.1(react@18.3.1) browser-image-resizer: 2.4.1 calendar-blocks: 0.3.1(react@18.3.1) - clsx: 2.1.0 + clsx: 2.1.1 color-interpolate: 1.0.5 color-parse: 2.0.2 color-space: 2.0.1 @@ -1427,13 +1490,15 @@ packages: prosemirror-model: 1.21.1 react: 18.3.1 react-dom: 18.2.0(react@18.3.1) + react-hot-toast: 2.4.1(csstype@3.1.3)(react-dom@18.2.0)(react@18.3.1) transitivePeerDependencies: - '@types/react' - '@types/react-dom' + - csstype dev: false - /@a-type/ui@0.8.19(@types/react-dom@18.2.25)(@types/react@18.2.79)(react-dom@18.3.1)(react@18.3.1): - resolution: {integrity: sha512-qAIkj6pqiEA2V7G4zybsklIXO4qS/c79jKrSovBC7K5jipch35RsDORPGPRA2OEpxaGbymGNUVzqWbk5msd8ig==} + /@a-type/ui@0.8.20(@types/react-dom@18.2.25)(@types/react@18.2.79)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-XFwp9ghCqtcLCSyVe7X7ZCMSKqGPBryCJxRUZDS+LSo4gODTSTJjjcMW0k4ZqeO9A/JvvZACO2Sc4FtX1LwPDw==} peerDependencies: react: ^18 react-dom: ^18 @@ -1477,18 +1542,20 @@ packages: prosemirror-model: 1.21.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + react-hot-toast: 2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) transitivePeerDependencies: - '@types/react' - '@types/react-dom' + - csstype dev: false - /@a-type/ui@0.8.19(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1): - resolution: {integrity: sha512-qAIkj6pqiEA2V7G4zybsklIXO4qS/c79jKrSovBC7K5jipch35RsDORPGPRA2OEpxaGbymGNUVzqWbk5msd8ig==} + /@a-type/ui@0.8.20(@types/react-dom@18.3.0)(@types/react@18.3.3)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-XFwp9ghCqtcLCSyVe7X7ZCMSKqGPBryCJxRUZDS+LSo4gODTSTJjjcMW0k4ZqeO9A/JvvZACO2Sc4FtX1LwPDw==} peerDependencies: react: ^18 react-dom: ^18 dependencies: - '@a-type/utils': 1.1.3 + '@a-type/utils': 1.1.0 '@radix-ui/react-accordion': 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-checkbox': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) @@ -1517,7 +1584,7 @@ packages: '@use-gesture/react': 10.3.1(react@18.3.1) browser-image-resizer: 2.4.1 calendar-blocks: 0.3.1(react@18.3.1) - clsx: 2.1.0 + clsx: 2.1.1 color-interpolate: 1.0.5 color-parse: 2.0.2 color-space: 2.0.1 @@ -1527,18 +1594,20 @@ packages: prosemirror-model: 1.21.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + react-hot-toast: 2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) transitivePeerDependencies: - '@types/react' - '@types/react-dom' + - csstype dev: false - /@a-type/ui@0.8.19(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1): - resolution: {integrity: sha512-qAIkj6pqiEA2V7G4zybsklIXO4qS/c79jKrSovBC7K5jipch35RsDORPGPRA2OEpxaGbymGNUVzqWbk5msd8ig==} + /@a-type/ui@0.8.20(@types/react@18.3.3)(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-XFwp9ghCqtcLCSyVe7X7ZCMSKqGPBryCJxRUZDS+LSo4gODTSTJjjcMW0k4ZqeO9A/JvvZACO2Sc4FtX1LwPDw==} peerDependencies: react: ^18 react-dom: ^18 dependencies: - '@a-type/utils': 1.1.3 + '@a-type/utils': 1.1.0 '@radix-ui/react-accordion': 1.1.2(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-checkbox': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-collapsible': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) @@ -1567,7 +1636,7 @@ packages: '@use-gesture/react': 10.3.1(react@18.3.1) browser-image-resizer: 2.4.1 calendar-blocks: 0.3.1(react@18.3.1) - clsx: 2.1.0 + clsx: 2.1.1 color-interpolate: 1.0.5 color-parse: 2.0.2 color-space: 2.0.1 @@ -1577,18 +1646,20 @@ packages: prosemirror-model: 1.21.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + react-hot-toast: 2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) transitivePeerDependencies: - '@types/react' - '@types/react-dom' + - csstype dev: true - /@a-type/ui@0.8.19(react-dom@18.3.1)(react@18.3.1): - resolution: {integrity: sha512-qAIkj6pqiEA2V7G4zybsklIXO4qS/c79jKrSovBC7K5jipch35RsDORPGPRA2OEpxaGbymGNUVzqWbk5msd8ig==} + /@a-type/ui@0.8.20(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-XFwp9ghCqtcLCSyVe7X7ZCMSKqGPBryCJxRUZDS+LSo4gODTSTJjjcMW0k4ZqeO9A/JvvZACO2Sc4FtX1LwPDw==} peerDependencies: react: ^18 react-dom: ^18 dependencies: - '@a-type/utils': 1.1.3 + '@a-type/utils': 1.1.0 '@radix-ui/react-accordion': 1.1.2(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-checkbox': 1.0.4(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-collapsible': 1.0.3(react-dom@18.3.1)(react@18.3.1) @@ -1617,7 +1688,7 @@ packages: '@use-gesture/react': 10.3.1(react@18.3.1) browser-image-resizer: 2.4.1 calendar-blocks: 0.3.1(react@18.3.1) - clsx: 2.1.0 + clsx: 2.1.1 color-interpolate: 1.0.5 color-parse: 2.0.2 color-space: 2.0.1 @@ -1627,9 +1698,11 @@ packages: prosemirror-model: 1.21.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + react-hot-toast: 2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) transitivePeerDependencies: - '@types/react' - '@types/react-dom' + - csstype dev: false /@a-type/utils@1.0.5: @@ -1646,7 +1719,6 @@ packages: /@a-type/utils@1.1.0: resolution: {integrity: sha512-dwM1bl6XQaC/X9RZQUp0LDGQF70nn0QV6TFq/bKsjqlt8OEBGWlr++um4oigl2QMKkwzto9XwoBJ/D38IvROIQ==} - dev: false /@a-type/utils@1.1.2: resolution: {integrity: sha512-VM/iA7Gco+RloJa8sNXdMgB+REIiNSL+H/ai4BJKPPUJq8woDY06Frd+XVw/V7lAorUrcBaGf0E1Z+7bXO9VMA==} @@ -1654,6 +1726,7 @@ packages: /@a-type/utils@1.1.3: resolution: {integrity: sha512-wdd3pHus6WNYzoBZjwZhn2DJhgtK02VE/fky7t6soEl4DIUZamaCJmHivmFX4mvHL5/WIq/T2iXyZjDIC5F3KQ==} + dev: false /@aashutoshrathi/word-wrap@1.2.6: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} @@ -14929,11 +15002,11 @@ packages: /clsx@2.1.0: resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==} engines: {node: '>=6'} + dev: false /clsx@2.1.1: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - dev: false /collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -17456,7 +17529,6 @@ packages: csstype: ^3.0.10 dependencies: csstype: 3.1.3 - dev: false /google-auth-library@9.2.0: resolution: {integrity: sha512-1oV3p0JhNEhVbj26eF3FAJcv9MXXQt4S0wcvKZaDbl4oHq5V3UJoSbsGZGQNcjoCdhW4kDSwOs11wLlHog3fgQ==} @@ -20574,7 +20646,6 @@ packages: react-dom: 18.3.1(react@18.3.1) transitivePeerDependencies: - csstype - dev: false /react-hotkeys-hook@4.5.0(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-Samb85GSgAWFQNvVt3PS90LPPGSf9mkH/r4au81ZP1yOIFayLC3QAvqTgGtJ8YEDMXtPmaVBs6NgipHO6h4Mug==} @@ -23300,7 +23371,7 @@ packages: '@vite-pwa/assets-generator': optional: true dependencies: - debug: 4.3.5 + debug: 4.3.4 fast-glob: 3.3.2 pretty-bytes: 6.1.1 vite: 5.2.7 diff --git a/server/package.json b/server/package.json index bb026a58..076c723e 100644 --- a/server/package.json +++ b/server/package.json @@ -19,7 +19,7 @@ "type": "module", "private": true, "dependencies": { - "@a-type/auth": "0.6.0", + "@a-type/auth": "0.6.5", "@a-type/utils": "1.1.3", "@aws-sdk/client-cloudfront": "^3.583.0", "@aws-sdk/client-s3": "3.583.0", diff --git a/server/src/auth/handlers.ts b/server/src/auth/handlers.ts index 7bde428d..510a7b4d 100644 --- a/server/src/auth/handlers.ts +++ b/server/src/auth/handlers.ts @@ -55,6 +55,7 @@ export const authHandlers = createHandlers({ .values({ id: id(), accessTokenExpiresAt: expiresAt ? new Date(expiresAt) : undefined, + ...account, }) .returning('id') diff --git a/web/package.json b/web/package.json index 7b1c66c8..d92d5098 100644 --- a/web/package.json +++ b/web/package.json @@ -9,7 +9,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@a-type/ui": "^0.8.19", + "@a-type/auth-client": "1.0.4", + "@a-type/ui": "^0.8.20", "@biscuits/apps": "workspace:*", "@biscuits/client": "workspace:*", "@biscuits/error": "workspace:*", diff --git a/web/src/components/auth/EmailCompleteSignupForm.tsx b/web/src/components/auth/EmailCompleteSignupForm.tsx deleted file mode 100644 index b728c9f8..00000000 --- a/web/src/components/auth/EmailCompleteSignupForm.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Input } from '@a-type/ui/components/input'; -import { Button } from '@a-type/ui/components/button'; -import { CONFIG } from '@biscuits/client'; - -export interface EmailCompleteSignUpFormProps { - code: string; - email: string; -} - -export function EmailCompleteSignupForm({ - code, - email, -}: EmailCompleteSignUpFormProps) { - return ( -
- - - - - -
- ); -} diff --git a/web/src/components/auth/EmailSignInForm.tsx b/web/src/components/auth/EmailSignInForm.tsx deleted file mode 100644 index 2f26e423..00000000 --- a/web/src/components/auth/EmailSignInForm.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { Button } from '@a-type/ui/components/button'; -import { - Dialog, - DialogContent, - DialogTrigger, -} from '@a-type/ui/components/dialog'; -import { Input } from '@a-type/ui/components/input'; -import { CONFIG } from '@biscuits/client'; - -export interface EmailSignInFormProps { - returnTo?: string; -} - -export function EmailSignInForm({ returnTo = '' }: EmailSignInFormProps) { - return ( -
- - - - - - - - ); -} - -function ForgotPassword({ className }: { className?: string }) { - return ( - - - - - -
- - - - -
-
-
- ); -} diff --git a/web/src/components/auth/EmailSignupForm.tsx b/web/src/components/auth/EmailSignupForm.tsx deleted file mode 100644 index c2901ab3..00000000 --- a/web/src/components/auth/EmailSignupForm.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Button } from '@a-type/ui/components/button'; -import { - FormikForm, - SubmitButton, - TextField, -} from '@a-type/ui/components/forms'; -import { Input } from '@a-type/ui/components/input'; -import { CONFIG, fetch } from '@biscuits/client'; -import { useState } from 'react'; -import { toast } from 'react-hot-toast'; - -export interface EmailSignUpFormProps { - returnTo?: string | null; - actionText?: string; - disabled?: boolean; -} - -export function EmailSignUpForm({ - returnTo, - actionText = 'Start signup', - disabled, -}: EmailSignUpFormProps) { - const [success, setSuccess] = useState(false); - - if (success) { - return ( -
-

Check your email for a verification code.

-
- ); - } - - return ( - { - if (disabled) return; - try { - // this API accepts form data - const formData = new FormData(); - formData.append('name', values.name); - formData.append('email', values.email); - formData.append('returnTo', returnTo ?? ''); - const response = await fetch( - `${CONFIG.API_ORIGIN}/auth/begin-email-signup`, - { - method: 'post', - body: formData, - headers: {}, - }, - ); - if (response.ok) { - setSuccess(true); - } - } catch (e) { - console.error(e); - } - }} - className="flex flex-col gap-2" - > - - - - {actionText} - - - ); -} diff --git a/web/src/components/auth/OAuthSignInButton.tsx b/web/src/components/auth/OAuthSignInButton.tsx deleted file mode 100644 index 07cf5308..00000000 --- a/web/src/components/auth/OAuthSignInButton.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Button, ButtonProps } from '@a-type/ui/components/button'; -import { CONFIG } from '@biscuits/client'; -import { ReactNode } from 'react'; - -export function OAuthSignInButton({ - provider, - returnTo, - children, - className, - inviteId, - ...rest -}: { - provider: string; - returnTo?: string | null; - children?: ReactNode; - inviteId?: string | null; -} & ButtonProps) { - const url = new URL(`${CONFIG.API_ORIGIN}/auth/provider/${provider}/login`); - if (returnTo) { - url.searchParams.set('returnTo', returnTo); - } - if (inviteId) { - url.searchParams.set('inviteId', inviteId); - } - - return ( -
- -
- ); -} diff --git a/web/src/components/auth/ResetPasswordForm.tsx b/web/src/components/auth/ResetPasswordForm.tsx deleted file mode 100644 index ae5ef6a5..00000000 --- a/web/src/components/auth/ResetPasswordForm.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Input } from '@a-type/ui/components/input'; -import { Button } from '@a-type/ui/components/button'; -import { CONFIG } from '@biscuits/client'; - -export interface EmailCompleteSignUpFormProps { - code: string; - email: string; -} - -export function EmailCompleteSignupForm({ - code, - email, -}: EmailCompleteSignUpFormProps) { - return ( -
- - - - - -
- ); -} diff --git a/web/src/pages/ClaimInvitePage.tsx b/web/src/pages/ClaimInvitePage.tsx index 9b4adc1a..b3232891 100644 --- a/web/src/pages/ClaimInvitePage.tsx +++ b/web/src/pages/ClaimInvitePage.tsx @@ -50,7 +50,7 @@ function ClaimInvitePage() { const isNotAuthenticated = infoResult.data && !infoResult.data.me; useEffect(() => { if (isNotAuthenticated) { - navigate(`/join?returnTo=${encodeURIComponent(`/claim/${code}`)}`); + navigate(`/login?returnTo=${encodeURIComponent(`/claim/${code}`)}`); } }, [navigate, isNotAuthenticated, code]); diff --git a/web/src/pages/LoginPage.tsx b/web/src/pages/LoginPage.tsx index 070f4c84..515ff639 100644 --- a/web/src/pages/LoginPage.tsx +++ b/web/src/pages/LoginPage.tsx @@ -1,6 +1,3 @@ -import { EmailSignInForm } from '@/components/auth/EmailSignInForm.jsx'; -import { EmailSignUpForm } from '@/components/auth/EmailSignupForm.jsx'; -import { OAuthSignInButton } from '@/components/auth/OAuthSignInButton.jsx'; import { P } from '@a-type/ui/components/typography'; import { useSearchParams } from '@verdant-web/react-router'; import { @@ -14,6 +11,12 @@ import { Footer } from '@/components/help/Footer.jsx'; import { Checkbox } from '@a-type/ui/components/checkbox'; import classNames from 'classnames'; import { AppId, appsById } from '@biscuits/apps'; +import { CONFIG } from '@biscuits/client'; +import { + OAuthSigninButton, + EmailSignupForm, + EmailSigninForm, +} from '@a-type/auth-client'; const Paws = lazy(() => import('@/components/paws/Paws.jsx')); @@ -77,33 +80,41 @@ export default function LoginPage() { - Sign up with Google - + - +

Welcome back!

- Sign in with Google - + - +
diff --git a/web/src/pages/ResetPasswordPage.tsx b/web/src/pages/ResetPasswordPage.tsx index c1db1984..20425c87 100644 --- a/web/src/pages/ResetPasswordPage.tsx +++ b/web/src/pages/ResetPasswordPage.tsx @@ -1,6 +1,7 @@ -import { EmailCompleteSignupForm } from '@/components/auth/EmailCompleteSignupForm.jsx'; +import { ResetPasswordForm } from '@a-type/auth-client'; import { PageContent, PageRoot } from '@a-type/ui/components/layouts'; import { H1, P } from '@a-type/ui/components/typography'; +import { CONFIG } from '@biscuits/client'; import { useSearchParams } from '@verdant-web/react-router'; export interface ResetPasswordPageProps {} @@ -25,7 +26,11 @@ export function ResetPasswordPage({}: ResetPasswordPageProps) {

Complete your signup

- +
); diff --git a/web/src/pages/VerifyPage.tsx b/web/src/pages/VerifyPage.tsx index e952ffba..867781be 100644 --- a/web/src/pages/VerifyPage.tsx +++ b/web/src/pages/VerifyPage.tsx @@ -1,6 +1,7 @@ -import { EmailCompleteSignupForm } from '@/components/auth/EmailCompleteSignupForm.jsx'; +import { EmailCompleteSignupForm } from '@a-type/auth-client'; import { PageContent, PageRoot } from '@a-type/ui/components/layouts'; import { H1, P } from '@a-type/ui/components/typography'; +import { CONFIG } from '@biscuits/client'; import { useNavigate, useSearchParams } from '@verdant-web/react-router'; export interface VerifyPageProps {} @@ -35,7 +36,11 @@ export function VerifyPage({}: VerifyPageProps) {

Complete your signup

- +
);