mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-07 06:55:23 +02:00
Update better-auth dependency to version 1.2.8 and enhance license key validation in the API to require at least one of enableEnterpriseFeatures or licenseKey.
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
"ai": "^5.0.17",
|
||||
"ai-sdk-ollama": "^0.5.1",
|
||||
"bcrypt": "5.1.1",
|
||||
"better-auth": "v1.2.8-beta.7",
|
||||
"better-auth": "v1.2.8",
|
||||
"bl": "6.0.11",
|
||||
"boxen": "^7.1.1",
|
||||
"bullmq": "5.4.2",
|
||||
|
||||
@@ -35,15 +35,22 @@ export const licenseKeyRouter = createTRPCRouter({
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
const currentUserId = ctx.user.id;
|
||||
|
||||
if (
|
||||
input.enableEnterpriseFeatures === undefined &&
|
||||
input.licenseKey === undefined
|
||||
) {
|
||||
throw new TRPCError({
|
||||
code: "BAD_REQUEST",
|
||||
message:
|
||||
"At least one of enableEnterpriseFeatures or licenseKey must be provided",
|
||||
});
|
||||
}
|
||||
|
||||
await db
|
||||
.update(user)
|
||||
.set({
|
||||
...(input.enableEnterpriseFeatures === undefined
|
||||
? {}
|
||||
: { enableEnterpriseFeatures: input.enableEnterpriseFeatures }),
|
||||
...(input.licenseKey === undefined
|
||||
? {}
|
||||
: { licenseKey: input.licenseKey }),
|
||||
// enableEnterpriseFeatures: input.enableEnterpriseFeatures ?? false,
|
||||
licenseKey: input.licenseKey ?? "",
|
||||
})
|
||||
.where(eq(user.id, currentUserId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user