mirror of
https://github.com/strapi/strapi.git
synced 2025-07-28 19:34:51 +00:00

Previously using default of v4, and this default functionality is now deprecated and you must instead specify the version
15 lines
281 B
JavaScript
15 lines
281 B
JavaScript
'use strict';
|
|
|
|
const { machineIdSync } = require('node-machine-id');
|
|
const { v4: uuidv4 } = require('uuid');
|
|
|
|
module.exports = () => {
|
|
try {
|
|
const deviceId = machineIdSync();
|
|
return deviceId;
|
|
} catch (error) {
|
|
const deviceId = uuidv4();
|
|
return deviceId;
|
|
}
|
|
};
|