mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-06 06:25:28 +02:00
Enhance License Key Management: Add loading state for license key validation, implement query to check for valid license keys, and improve UI feedback during license key checks.
This commit is contained in:
@@ -126,6 +126,23 @@ export const licenseKeyRouter = createTRPCRouter({
|
||||
licenseKey: currentUser.licenseKey ?? "",
|
||||
};
|
||||
}),
|
||||
haveValidLicenseKey: adminProcedure.query(async ({ ctx }) => {
|
||||
const currentUserId = ctx.user.id;
|
||||
const currentUser = await db.query.user.findFirst({
|
||||
where: eq(user.id, currentUserId),
|
||||
});
|
||||
if (!currentUser?.enableEnterpriseFeatures) {
|
||||
return false;
|
||||
}
|
||||
if (!currentUser.licenseKey) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return await validateLicenseKey(currentUser.licenseKey ?? "");
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}),
|
||||
|
||||
updateEnterpriseSettings: adminProcedure
|
||||
.input(
|
||||
|
||||
Reference in New Issue
Block a user