Skip to content

Commit 01a6dea

Browse files
committed
fix(sso)!: Block user to sign up with email already exists in database
1 parent 2e17893 commit 01a6dea

File tree

31 files changed

+3189
-816
lines changed

31 files changed

+3189
-816
lines changed

apps/api/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
"@vitnode/core": "workspace:*",
2222
"drizzle-kit": "^0.31.4",
2323
"drizzle-orm": "^0.44.3",
24-
"hono": "^4.8.5",
24+
"hono": "^4.8.9",
2525
"next-intl": "^4.3.4",
2626
"react": "^19.1.0",
2727
"react-dom": "^19.1.0",
28-
"zod": "^4.0.5"
28+
"zod": "^4.0.10"
2929
},
3030
"devDependencies": {
3131
"@hono/node-server": "^1.17.1",
3232
"@types/node": "^24.1.0",
3333
"@types/react": "^19.1.8",
3434
"@types/react-dom": "^19.1.6",
3535
"@vitnode/eslint-config": "workspace:*",
36-
"dotenv": "^17.2.0",
37-
"eslint": "^9.31.0",
38-
"react-email": "^4.2.3",
36+
"dotenv": "^17.2.1",
37+
"eslint": "^9.32.0",
38+
"react-email": "^4.2.4",
3939
"tsc-alias": "^1.8.16",
4040
"tsx": "^4.20.3",
4141
"typescript": "^5.8.3"

apps/api/src/locales/@vitnode/core/en.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
"403": {
6161
"title": "Forbidden",
6262
"desc": "You don't have permission to access this resource."
63+
},
64+
"409": {
65+
"title": "Conflict",
66+
"desc": "The request could not be completed due to a conflict with the current state of the resource."
6367
}
6468
},
6569
"user_bar": {
@@ -70,7 +74,12 @@
7074
"auth": {
7175
"sso": {
7276
"or": "Or continue With",
73-
"access_denied": "You have denied access to the application or the request has expired. Please try again."
77+
"access_denied": "You have denied access to the application or the request has expired. Please try again.",
78+
"email_exists": {
79+
"title": "You cannot sign in with <provider></provider>",
80+
"desc": "An account with this email already exists. Please sign in with another method and connect your <provider></provider> account in your profile settings.",
81+
"sign_in": "Go to Login Page"
82+
}
7483
},
7584
"sign_up": {
7685
"desc": "Hello there! Create your account to get started.",

apps/docs/content/docs/dev/email/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const testRoute = buildRoute({
2828
await c.get('email').send({
2929
3030
subject: 'Test Email',
31-
content: 'This is a test email.',
31+
content: () => 'This is a test email.',
3232
});
3333

3434
return c.text('test');

apps/docs/content/docs/dev/email/templates.mdx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,44 @@ VitNode uses [React Email](https://react.email/) to create email templates. This
1313
The current `TailwindCSS` version used for this component is **3.4.10**
1414
</Callout>
1515

16+
## Usage
17+
18+
Inside your:
19+
20+
- plugin directory => `plugins/{your_plugin}/src/emails/`,
21+
- or in the directory of your application => `src/emails/`
22+
23+
you can create your email templates. The templates should be React components that return JSX and to be exported as default.
24+
25+
```tsx title="src/emails/test-template.tsx"
26+
import { Text } from '@react-email/components';
27+
28+
export default function TestTemplateEmail() {
29+
return <Text>This is a test email template.</Text>;
30+
}
31+
```
32+
33+
```ts title="src/api/modules/users/routes/test.route.ts"
34+
import { z } from 'zod';
35+
import { buildRoute } from '@vitnode/core/api/lib/route';
36+
37+
// [!code ++]
38+
import TestTemplateEmail from '@/emails/test-template';
39+
40+
export const testRoute = buildRoute({
41+
handler: async c => {
42+
await c.get('email').send({
43+
44+
subject: 'Test Email',
45+
// [!code ++]
46+
content: TestTemplateEmail,
47+
});
48+
49+
return c.text('test');
50+
},
51+
});
52+
```
53+
1654
## Components
1755

1856
<Cards>

apps/docs/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
"babel-plugin-react-compiler": "19.1.0-rc.2",
2929
"drizzle-kit": "^0.31.4",
3030
"drizzle-orm": "^0.44.3",
31-
"fumadocs-core": "^15.6.5",
32-
"fumadocs-mdx": "^11.7.0",
33-
"fumadocs-ui": "^15.6.5",
34-
"hono": "^4.8.5",
35-
"lucide-react": "^0.525.0",
36-
"motion": "^12.23.6",
37-
"next": "^15.4.2",
31+
"fumadocs-core": "^15.6.6",
32+
"fumadocs-mdx": "^11.7.1",
33+
"fumadocs-ui": "^15.6.6",
34+
"hono": "^4.8.9",
35+
"lucide-react": "^0.526.0",
36+
"motion": "^12.23.9",
37+
"next": "^15.4.4",
3838
"next-intl": "^4.3.4",
3939
"react": "^19.1.0",
4040
"react-dom": "^19.1.0",
41-
"react-hook-form": "^7.60.0",
41+
"react-hook-form": "^7.61.1",
4242
"react-use": "^17.6.0",
4343
"sonner": "^2.0.6"
4444
},
@@ -51,13 +51,13 @@
5151
"@types/react-dom": "^19.1.6",
5252
"@vitnode/eslint-config": "workspace:*",
5353
"class-variance-authority": "^0.7.1",
54-
"eslint": "^9.31.0",
54+
"eslint": "^9.32.0",
5555
"postcss": "^8.5.6",
56-
"react-email": "^4.2.3",
56+
"react-email": "^4.2.4",
5757
"shiki": "^3.8.1",
5858
"tailwindcss": "^4.1.11",
59-
"tw-animate-css": "^1.3.5",
59+
"tw-animate-css": "^1.3.6",
6060
"typescript": "^5.8.3",
61-
"zod": "^4.0.5"
61+
"zod": "^4.0.10"
6262
}
6363
}

apps/docs/src/locales/@vitnode/core/en.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
"403": {
6161
"title": "Forbidden",
6262
"desc": "You don't have permission to access this resource."
63+
},
64+
"409": {
65+
"title": "Conflict",
66+
"desc": "The request could not be completed due to a conflict with the current state of the resource."
6367
}
6468
},
6569
"user_bar": {
@@ -70,7 +74,12 @@
7074
"auth": {
7175
"sso": {
7276
"or": "Or continue With",
73-
"access_denied": "You have denied access to the application or the request has expired. Please try again."
77+
"access_denied": "You have denied access to the application or the request has expired. Please try again.",
78+
"email_exists": {
79+
"title": "You cannot sign in with <provider></provider>",
80+
"desc": "An account with this email already exists. Please sign in with another method and connect your <provider></provider> account in your profile settings.",
81+
"sign_in": "Go to Login Page"
82+
}
7483
},
7584
"sign_up": {
7685
"desc": "Hello there! Create your account to get started.",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"test:e2e": "turbo test:e2e"
1919
},
2020
"devDependencies": {
21-
"@types/node": "^24.0.15",
21+
"@types/node": "^24.1.0",
2222
"@vitnode/eslint-config": "workspace:*",
2323
"prettier": "^3.6.2",
2424
"prettier-plugin-tailwindcss": "^0.6.14",
2525
"tsx": "^4.20.3",
2626
"turbo": "^2.5.5",
2727
"typescript": "^5.8.3",
28-
"zod": "^4.0.5"
28+
"zod": "^4.0.10"
2929
},
3030
"engines": {
3131
"node": ">=22"

packages/create-vitnode-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@types/prompts": "^2.4.9",
4040
"@types/validate-npm-package-name": "^4.0.2",
4141
"@vitnode/eslint-config": "workspace:*",
42-
"eslint": "^9.31.0",
42+
"eslint": "^9.32.0",
4343
"typescript": "^5.8.3"
4444
}
4545
}

packages/create-vitnode-app/src/create/create-package-json.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const createPackageJSON = async ({
7171
: {}),
7272
turbo: '^2.5.5',
7373
typescript: '^5.8.3',
74-
zod: '^4.0.5',
74+
zod: '^4.0.10',
7575
},
7676
packageManager: `${packageManager}@${availablePackageManagers[packageManager]}`,
7777
workspaces: ['apps/*', 'plugins/*'],
@@ -122,11 +122,11 @@ export const createPackageJSON = async ({
122122
'@vitnode/core': pkgVitNodeVersion,
123123
'drizzle-kit': '^0.31.3',
124124
'drizzle-orm': '^0.44.3',
125-
hono: '^4.8.5',
125+
hono: '^4.8.9',
126126
'next-intl': '^4.3.1',
127127
react: '^19.1',
128128
'react-dom': '^19.1',
129-
zod: '^4.0.5',
129+
zod: '^4.0.10',
130130
},
131131
devDependencies: {
132132
'@hono/node-server': '^1.17.1',
@@ -139,10 +139,10 @@ export const createPackageJSON = async ({
139139
'@types/react': '^19.1',
140140
'@types/react-dom': '^19.1',
141141
'@vitnode/eslint-config': pkgVitNodeVersion,
142-
dotenv: '^17.2.0',
142+
dotenv: '^17.2.1',
143143
...(eslint
144144
? {
145-
eslint: '^9.31.0',
145+
eslint: '^9.32.0',
146146
...(mode === 'onlyApi'
147147
? {
148148
'prettier-plugin-tailwindcss': '^0.6.14',
@@ -151,7 +151,7 @@ export const createPackageJSON = async ({
151151
: {}),
152152
}
153153
: {}),
154-
'react-email': '^4.2.3',
154+
'react-email': '^4.2.4',
155155
'tsc-alias': '^1.8.16',
156156
tsx: '^4.20.3',
157157
typescript: '^5.8.3',
@@ -193,15 +193,15 @@ export const createPackageJSON = async ({
193193
'babel-plugin-react-compiler': '19.1.0-rc.2',
194194
'drizzle-kit': '^0.31.4',
195195
'drizzle-orm': '^0.44.3',
196-
hono: '^4.8.5',
197-
'lucide-react': '^0.525.0',
198-
next: '^15.4.2',
196+
hono: '^4.8.9',
197+
'lucide-react': '^0.526.0',
198+
next: '^15.4.4',
199199
'next-intl': '^4.3.4',
200200
react: '^19.1',
201201
'react-dom': '^19.1',
202-
'react-hook-form': '^7.60.0',
202+
'react-hook-form': '^7.61.1',
203203
sonner: '^2.0.6',
204-
zod: '^4.0.5',
204+
zod: '^4.0.10',
205205
},
206206
devDependencies: {
207207
'@tailwindcss/postcss': '^4.1.11',
@@ -211,15 +211,15 @@ export const createPackageJSON = async ({
211211
'@vitnode/eslint-config': pkgVitNodeVersion,
212212
...(eslint
213213
? {
214-
eslint: '^9.31.0',
214+
eslint: '^9.32.0',
215215
'prettier-plugin-tailwindcss': '^0.6.14',
216216
prettier: '^3.6.2',
217217
}
218218
: {}),
219-
'react-email': '^4.2.3',
219+
'react-email': '^4.2.4',
220220
turbo: '^2.5.5',
221221
tailwindcss: '^4.1.11',
222-
'tw-animate-css': '^1.3.5',
222+
'tw-animate-css': '^1.3.6',
223223
typescript: '^5.8.3',
224224
},
225225
packageManager: `${packageManager}@${availablePackageManagers[packageManager]}`,
@@ -255,12 +255,12 @@ export const createPackageJSON = async ({
255255
dependencies: {
256256
'@vitnode/core': pkgVitNodeVersion,
257257
'babel-plugin-react-compiler': '19.1.0-rc.2',
258-
'lucide-react': '^0.525.0',
259-
next: '^15.4.2',
258+
'lucide-react': '^0.526.0',
259+
next: '^15.4.4',
260260
'next-intl': '^4.3.4',
261261
react: '^19.1',
262262
'react-dom': '^19.1',
263-
'react-hook-form': '^7.60.0',
263+
'react-hook-form': '^7.61.1',
264264
sonner: '^2.0.6',
265265
},
266266
devDependencies: {
@@ -274,14 +274,14 @@ export const createPackageJSON = async ({
274274
'class-variance-authority': '^0.7.1',
275275
...(eslint
276276
? {
277-
eslint: '^9.31.0',
277+
eslint: '^9.32.0',
278278
}
279279
: {}),
280280
postcss: '^8.5.6',
281281
tailwindcss: '^4.1.11',
282-
'tw-animate-css': '^1.3.5',
282+
'tw-animate-css': '^1.3.6',
283283
typescript: '^5.8.3',
284-
zod: '^4.0.5',
284+
zod: '^4.0.10',
285285
},
286286
};
287287

packages/eslint/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export default [
7575
{ files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'] },
7676
{
7777
rules: {
78+
'react-hooks/exhaustive-deps': 'off',
7879
'@eslint-react/no-context-provider': 'off',
7980
'@eslint-react/no-unstable-default-props': 'off',
8081
'perfectionist/sort-array-includes': 'warn',

0 commit comments

Comments
 (0)