NextAuth.js tabanlı kimlik doğrulama sistemi. İki farklı senaryo için kimlik doğrulama sağlar.
{ "email": string, "password": string, "hwid": string // Optional,
required for app auth }
{ "strategy": "jwt", "maxAge": 1800 // 30 minutes }
{ "id": string, "email": string, "name": string, "role": string }
Yeni kullanıcı kaydı oluşturur.
{ "name": string, "email": string, "password": string, "hwid":
string (optional) }
{ "message": "User created successfully" }
{ "message": "This email is already registered" }
{ "message": "This username is already taken" }
{ "message": "This HWID is already registered to our system"
}
{ "message": "Error occurred during registration" }
Lisans yönetimi - listeleme ve oluşturma (Admin only)
Admin yetkisi gerekli (ADMIN_EMAIL kontrolü)
[{ "key": string, "duration": number, "status": "unused" | "used",
"createdAt": Date, "updatedAt": Date }]
{ "duration": number }
{ "key": string, // randomly generated "duration": number,
"status": "unused" }
{ "error": "Unauthorized" }{ "error": "Failed to fetch/create license" }
HWID yönetimi - kontrol ve güncelleme
Query Parameters: email (string)
{ "hwid": string | null }
{ "email": string, "hwid": string }
{ "success": true }
{ "error": "Kullanıcı bulunamadı" }{ "error": "HWID işlemi başarısız oldu" }
Tüm ürünleri listeler
[ProductObject]
{ "error": "Failed to fetch products" }
Belirli bir ürünün detaylarını getirir
id: Product ID
ProductObject
{ "error": "Failed to fetch products" }
LemonSqueezy ürün detaylarını getirir
id: LemonSqueezy Product ID
{ "name": string, "price": string, "buy_now_url": string }
{ "error": "Failed to fetch product data" }
Lisans anahtarı aktivasyonu ve HWID bağlama
{ "key": string, "hwid": string }
{ "message": "License activated successfully", "expiresAt": Date }
{ "error": "Invalid license key" }{ "error": "License already in use" }{ "error": "HWID already registered" }{ "error": "License expired" }{ "error": "Activation failed" }Kullanıcının HWID bilgisini sıfırlar
{ "userId": string }
Admin veya moderatör yetkisi gerekli
{ "message": "HWID reset successful", "user": UserObject }
{ "error": "Unauthorized" }{ "error": "User not found" }{ "error": "Failed to reset HWID" }