Skip to content

Commit f233754

Browse files
committed
feat: added better-auth infra
1 parent 2a6b877 commit f233754

5 files changed

Lines changed: 66 additions & 2 deletions

File tree

apps/api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@ai-sdk/openai": "^3.0.18",
1717
"@aws-sdk/client-s3": "^3.975.0",
1818
"@aws-sdk/s3-request-presigner": "^3.975.0",
19+
"@better-auth/infra": "^0.1.8",
1920
"@cossistant/core": "workspace:*",
2021
"@cossistant/jobs": "workspace:*",
2122
"@cossistant/location": "workspace:*",

apps/api/src/lib/auth.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { db } from "@api/db";
22
import * as schema from "@api/db/schema";
33
import { env } from "@api/env";
44
import { generateULID } from "@api/utils/db/ids";
5+
import { dash } from "@better-auth/infra";
56
import { ResetPasswordEmail, sendEmail } from "@cossistant/transactional";
67
import { polar, portal, usage } from "@polar-sh/better-auth";
78
import { drizzleAdapter } from "better-auth/adapters/drizzle";
89
import { betterAuth } from "better-auth/minimal";
10+
911
import {
1012
admin,
1113
anonymous,
@@ -64,6 +66,7 @@ export const auth = betterAuth({
6466
},
6567
},
6668
plugins: [
69+
dash(),
6770
organizationPlugin({
6871
teams: {
6972
enabled: true,

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dependencies": {
77
"@ai-sdk/openai": "^3.0.18",
88
"@ai-sdk/react": "^3.0.51",
9+
"@better-auth/infra": "^0.1.8",
910
"@cossistant/api": "workspace:*",
1011
"@cossistant/core": "workspace:*",
1112
"@cossistant/location": "workspace:*",

apps/web/src/lib/auth/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sentinelClient } from "@better-auth/infra/client";
12
import { adminClient, organizationClient } from "better-auth/client/plugins";
23
import { createAuthClient } from "better-auth/react";
34

@@ -8,7 +9,7 @@ export const authClient = createAuthClient({
89
fetchOptions: {
910
credentials: "include" as const,
1011
},
11-
plugins: [organizationClient(), adminClient()],
12+
plugins: [organizationClient(), adminClient(), sentinelClient()],
1213
});
1314

1415
// Alias requestPasswordReset as forgetPassword for backwards compatibility

bun.lock

Lines changed: 59 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)