Skip to content

Commit f19c1e9

Browse files
committed
Merge branch 'main' into feat/add-pkce-like-session-binding
2 parents c5c5882 + 798a9e8 commit f19c1e9

File tree

23 files changed

+3587
-1640
lines changed

23 files changed

+3587
-1640
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
- name: Setup
5555
uses: ./tooling/github/setup
5656

57+
- name: Copy env
58+
shell: bash
59+
run: cp .env.example .env
60+
5761
- name: Typecheck
5862
run: pnpm typecheck
5963
# TODO: Add test CI

apps/web/package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"with-env": "dotenv -e ../../.env --",
1515
"test": "vitest",
1616
"storybook": "CI=1 storybook dev -p 6006",
17+
"docker": "docker-compose up",
1718
"build-storybook": "CI=1 storybook build"
1819
},
1920
"dependencies": {
@@ -34,16 +35,16 @@
3435
"iron-session": "^8.0.4",
3536
"lodash-es": "^4.17.21",
3637
"nanoid": "^5.1.6",
37-
"next": "16.0.3",
38+
"next": "catalog:next",
3839
"nextjs-toploader": "^3.9.17",
39-
"nuqs": "^2.7.3",
40-
"react": "19.2.0",
40+
"nuqs": "^2.8.2",
41+
"react": "catalog:react",
4142
"react-aria-components": "catalog:",
42-
"react-dom": "19.2.0",
43+
"react-dom": "catalog:react",
4344
"react-hook-form": "catalog:",
4445
"react-icons": "^5.5.0",
4546
"superjson": "2.2.5",
46-
"type-fest": "^5.2.0",
47+
"type-fest": "^5.3.0",
4748
"usehooks-ts": "^3.1.1",
4849
"zod": "catalog:"
4950
},
@@ -61,26 +62,26 @@
6162
"@tanstack/react-query-devtools": "catalog:react-query5",
6263
"@types/lodash-es": "^4.17.12",
6364
"@types/node": "catalog:",
64-
"@types/react": "19.2.4",
65-
"@types/react-dom": "19.2.3",
65+
"@types/react": "catalog:react",
66+
"@types/react-dom": "catalog:react",
6667
"@vitest/browser": "catalog:vitest",
6768
"@vitest/browser-playwright": "catalog:vitest",
6869
"@vitest/coverage-v8": "catalog:vitest",
6970
"dotenv-cli": "catalog:",
7071
"eslint": "catalog:",
7172
"jiti": "^2.6.1",
72-
"msw": "^2.12.1",
73+
"msw": "^2.12.3",
7374
"msw-storybook-addon": "^2.0.6",
7475
"msw-trpc": "^2.0.1",
75-
"playwright": "^1.56.1",
76+
"playwright": "^1.57.0",
7677
"prettier": "catalog:",
7778
"storybook": "catalog:storybook10",
7879
"storybook-addon-vite-mock": "catalog:storybook10",
7980
"tailwindcss": "catalog:tailwindcss4",
80-
"testcontainers": "^11.8.1",
81+
"testcontainers": "^11.9.0",
8182
"tw-animate-css": "^1.4.0",
8283
"typescript": "catalog:",
83-
"vite": "^7.2.2",
84+
"vite": "^7.2.6",
8485
"vite-tsconfig-paths": "^5.1.4",
8586
"vitest": "catalog:vitest",
8687
"vitest-mock-extended": "^3.1.0"

apps/web/src/server/modules/auth/auth.service.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,26 @@ export const emailVerifyOtp = async ({
121121
})
122122
}
123123

124+
// NOTE: You can also use `kysely` for your queries
125+
// if you want more fine-grained control.
124126
// Valid token, delete record to prevent reuse
125-
return db.verificationToken.delete({
126-
where: {
127-
identifier: vfnIdentifier,
128-
},
129-
})
127+
return db.$kysely
128+
.deleteFrom('VerificationToken')
129+
.where('identifier', '=', vfnIdentifier)
130+
.returningAll()
131+
.executeTakeFirstOrThrow(
132+
// NOTE: If we are unable to find the token,
133+
// this means that it has been deleted between
134+
// our initial query and the deletion here
135+
() =>
136+
new TRPCError({
137+
code: 'BAD_REQUEST',
138+
message:
139+
'Token is invalid or has expired. Please request a new OTP.',
140+
}),
141+
)
130142
} catch (error) {
131-
// see error code here: https://www.prisma.io/docs/reference/api-reference/error-reference#p2025
143+
// see error code here: https://www.prisma.io/docs/orm/reference/error-reference#p2025
132144
if (
133145
error instanceof Prisma.PrismaClientKnownRequestError &&
134146
error.code === 'P2025'

apps/web/turbo.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
"dependsOn": ["^build"],
77
"outputs": [".next/**", "!.next/cache/**", "next-env.d.ts"]
88
},
9+
"docker": {
10+
"cache": false
11+
},
912
"dev": {
10-
"persistent": true
13+
"persistent": true,
14+
"dependsOn": ["docker"]
1115
}
1216
}
1317
}

apps/web/vercel.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://openapi.vercel.sh/vercel.json",
3+
"buildCommand": "turbo vercel-build"
4+
}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
- POSTGRES_USER=root
99
- POSTGRES_PASSWORD=root
1010
volumes:
11-
- postgres-volume:/var/lib/postgresql/data
11+
- postgres-volume:/var/lib/postgresql
1212

1313
volumes:
1414
postgres-volume:

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
"private": true,
44
"engines": {
55
"node": ">=24.11.1",
6-
"pnpm": ">=10.18.1"
6+
"pnpm": ">=10.17.1"
77
},
8-
"packageManager": "[email protected]+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
98
"scripts": {
109
"build": "turbo run build",
1110
"vercel-build": "turbo run vercel-build",
@@ -33,5 +32,6 @@
3332
"typescript": "catalog:",
3433
"vitest": "^4.0.8"
3534
},
36-
"prettier": "@acme/prettier-config"
35+
"prettier": "@acme/prettier-config",
36+
"packageManager": "[email protected]+sha512.17c560fca4867ae9473a3899ad84a88334914f379be46d455cbf92e5cf4b39d34985d452d2583baf19967fa76cb5c17bc9e245529d0b98745721aa7200ecaf7a"
3737
}

0 commit comments

Comments
 (0)