feat(licenses): add license management and user authentication features

- Introduced a new SQL schema for managing licenses and users, including foreign key relationships.
- Implemented API routes for license validation, activation, and OTP-based user authentication.
- Updated the license creation process to associate licenses with users and handle server IPs.
- Added support for the nanoid package to generate unique license keys.
- Refactored existing code to improve modularity and maintainability, including the separation of license and stripe-related logic into dedicated API routes.
- Enhanced error handling and logging for better debugging and user feedback.
This commit is contained in:
Mauricio Siu
2025-03-23 18:32:50 -06:00
parent 5180c785b4
commit 39e6a98179
11 changed files with 724 additions and 365 deletions

View File

@@ -18,7 +18,6 @@ interface ResendLicenseEmailProps {
customerName: string;
licenseKey: string;
productName: string;
expirationDate: Date;
requestDate?: Date;
}
@@ -28,15 +27,8 @@ export const ResendLicenseEmail = ({
customerName = "John Doe",
licenseKey = "1234567890",
productName = "Dokploy",
expirationDate = new Date(),
requestDate = new Date(),
}: ResendLicenseEmailProps): React.ReactElement => {
const formattedDate = expirationDate.toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
});
const formattedRequestDate = requestDate.toLocaleDateString("en-US", {
year: "numeric",
month: "long",
@@ -75,12 +67,6 @@ export const ResendLicenseEmail = ({
<Text style={licenseKeyStyle}>{licenseKey}</Text>
</Section>
<Section style={validitySection}>
<Text style={validityText}>
🗓️ Valid until: <strong>{formattedDate}</strong>
</Text>
</Section>
<Section style={activationSection}>
<Heading as="h2" style={h2}>
Quick Activation Guide