@checkstack/auth-backend 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/package.json +12 -10
- package/src/index.ts +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @checkstack/auth-backend
|
|
2
2
|
|
|
3
|
+
## 0.4.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 67158e2: Standardize package metadata, unify AJV versions to 8.18.0, and enforce monorepo architecture rules via updated ESLint configuration. This ensures consistent package discovery and runtime dependency safety across the platform.
|
|
8
|
+
- b839ccb: Security: Hardened production Docker image by upgrading Alpine system libraries, migrating to Drizzle beta (v1.0.0-beta.21), and implementing aggressive binary pruning to eliminate vulnerable build-time tools (esbuild/drizzle-kit).
|
|
9
|
+
- Updated dependencies [67158e2]
|
|
10
|
+
- @checkstack/auth-common@0.5.7
|
|
11
|
+
- @checkstack/backend-api@0.8.2
|
|
12
|
+
- @checkstack/command-backend@0.1.13
|
|
13
|
+
- @checkstack/common@0.6.4
|
|
14
|
+
- @checkstack/notification-common@0.2.7
|
|
15
|
+
|
|
3
16
|
## 0.4.10
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/auth-backend",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
|
+
"checkstack": {
|
|
7
|
+
"type": "backend"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"typecheck": "tsc --noEmit",
|
|
8
11
|
"generate": "drizzle-kit generate",
|
|
@@ -11,24 +14,23 @@
|
|
|
11
14
|
"test": "bun test"
|
|
12
15
|
},
|
|
13
16
|
"dependencies": {
|
|
14
|
-
"@checkstack/auth-common": "0.5.
|
|
15
|
-
"@checkstack/backend-api": "0.8.
|
|
16
|
-
"@checkstack/notification-common": "0.2.
|
|
17
|
-
"@checkstack/command-backend": "0.1.
|
|
17
|
+
"@checkstack/auth-common": "0.5.6",
|
|
18
|
+
"@checkstack/backend-api": "0.8.1",
|
|
19
|
+
"@checkstack/notification-common": "0.2.6",
|
|
20
|
+
"@checkstack/command-backend": "0.1.12",
|
|
18
21
|
"better-auth": "^1.4.7",
|
|
19
|
-
"drizzle-orm": "^0.45.
|
|
20
|
-
"hono": "^4.
|
|
22
|
+
"drizzle-orm": "^0.45.0",
|
|
23
|
+
"hono": "^4.12.14",
|
|
21
24
|
"jose": "^6.1.3",
|
|
22
25
|
"zod": "^4.2.1",
|
|
23
|
-
"@checkstack/common": "0.6.
|
|
26
|
+
"@checkstack/common": "0.6.3",
|
|
27
|
+
"@orpc/server": "^1.13.2"
|
|
24
28
|
},
|
|
25
29
|
"devDependencies": {
|
|
26
30
|
"@checkstack/drizzle-helper": "0.0.3",
|
|
27
31
|
"@checkstack/scripts": "0.1.1",
|
|
28
32
|
"@checkstack/tsconfig": "0.0.3",
|
|
29
|
-
"@orpc/server": "^1.13.2",
|
|
30
33
|
"@types/node": "^20.0.0",
|
|
31
|
-
"drizzle-kit": "^0.31.8",
|
|
32
34
|
"typescript": "^5.0.0"
|
|
33
35
|
}
|
|
34
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { NotificationApi } from "@checkstack/notification-common";
|
|
|
20
20
|
import * as schema from "./schema";
|
|
21
21
|
import { eq, inArray } from "drizzle-orm";
|
|
22
22
|
import { SafeDatabase } from "@checkstack/backend-api";
|
|
23
|
-
import { User } from "better-auth/types";
|
|
23
|
+
import { BetterAuthOptions, User } from "better-auth/types";
|
|
24
24
|
import { verifyPassword } from "better-auth/crypto";
|
|
25
25
|
import { createExtensionPoint } from "@checkstack/backend-api";
|
|
26
26
|
import { enrichUser } from "./utils/user";
|
|
@@ -564,7 +564,7 @@ export default createBackendPlugin({
|
|
|
564
564
|
} social providers: ${Object.keys(socialProviders).join(", ")}`,
|
|
565
565
|
);
|
|
566
566
|
|
|
567
|
-
|
|
567
|
+
const authOptions: BetterAuthOptions = {
|
|
568
568
|
database: drizzleAdapter(database, {
|
|
569
569
|
provider: "pg",
|
|
570
570
|
schema: { ...schema },
|
|
@@ -586,10 +586,13 @@ export default createBackendPlugin({
|
|
|
586
586
|
const resetToken = parsedUrl.searchParams.get("token");
|
|
587
587
|
if (!resetToken) {
|
|
588
588
|
throw new APIError("BAD_REQUEST", {
|
|
589
|
-
message:
|
|
589
|
+
message:
|
|
590
|
+
"Malformed password reset URL: missing token parameter",
|
|
590
591
|
});
|
|
591
592
|
}
|
|
592
|
-
const resetUrl = `${frontendUrl}/auth/reset-password?token=${encodeURIComponent(
|
|
593
|
+
const resetUrl = `${frontendUrl}/auth/reset-password?token=${encodeURIComponent(
|
|
594
|
+
resetToken,
|
|
595
|
+
)}`;
|
|
593
596
|
|
|
594
597
|
void notificationClient.sendTransactional({
|
|
595
598
|
userId: user.id,
|
|
@@ -648,7 +651,9 @@ export default createBackendPlugin({
|
|
|
648
651
|
},
|
|
649
652
|
},
|
|
650
653
|
},
|
|
651
|
-
}
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
return betterAuth(authOptions);
|
|
652
657
|
};
|
|
653
658
|
|
|
654
659
|
// Initialize better-auth
|