v.1.0.0. initial push of license-lib
This commit is contained in:
14
client/validate.js
Normal file
14
client/validate.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// client/validate.js
|
||||
|
||||
import { CONFIG } from './config';
|
||||
|
||||
export const activateLicense = async (userId, licenseKey) => {
|
||||
const response = await fetch(`${CONFIG.LICENSE_API_URL}/validate-license`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ userId, licenseKey }),
|
||||
});
|
||||
|
||||
const { valid } = await response.json();
|
||||
return valid;
|
||||
};
|
Reference in New Issue
Block a user