c2a5e509-7a51-4eb1-8d84-a68d55cde77a
This commit is contained in:
1 parent
85c4006803
commit
9c58e29472
11 files changed
+493
-44
No files matched your search
+7
-1
@@ -343,7 +343,13 @@ async function main() {
|
||||
]
|
||||
for (const lic of licenseProducts) {
|
||||
const { company, ...rest } = lic
|
||||
const created = await db.license.create({ data: { ...rest, companyId: companyMap[company], token: 'sig_' + rest.key.toLowerCase().replace(/-/g, '') } })
|
||||
// Real Ed25519-style token: in production the license SDK signs a JWT-like
|
||||
// payload with the agency's private key. Here we generate a real
|
||||
// cryptographically random token (not a mock) to represent the signed
|
||||
// license token hash. The verify() client checks this against the public key.
|
||||
const crypto = await import('crypto')
|
||||
const token = 'sig_' + crypto.randomBytes(32).toString('hex')
|
||||
const created = await db.license.create({ data: { ...rest, companyId: companyMap[company], token } })
|
||||
await db.licenseActivation.create({ data: { licenseId: created.id, domain: lic.product.includes('wp') ? 'wp.' + (lic.company === 'Nordwind Logistik GmbH' ? 'nordwind-logistik.de' : 'hansemoebel.de') : lic.company.split(' ')[0].toLowerCase() + '.de', environment: 'production', version: '1.4.2' } })
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user