mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Revert to use crypto module on the server code, fix couple of minor code issues
This commit is contained in:
parent
5620b25138
commit
16c0e79557
@ -1,14 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const hash = require('hash.js');
|
||||
const crypto = require('crypto');
|
||||
|
||||
const generateAdminUserHash = (ctx) => {
|
||||
if (!ctx?.state?.user) return '';
|
||||
try {
|
||||
return hash.sha256().update(ctx.state.user.email).digest('hex');
|
||||
} catch (error) {
|
||||
if (!ctx?.state?.user) {
|
||||
return '';
|
||||
}
|
||||
return crypto.createHash('sha256').update(ctx.state.user.email).digest('hex');
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -106,7 +106,6 @@
|
||||
"execa": "5.1.1",
|
||||
"fs-extra": "10.0.0",
|
||||
"glob": "7.2.0",
|
||||
"hash.js": "1.1.7",
|
||||
"http-errors": "1.8.1",
|
||||
"inquirer": "8.2.4",
|
||||
"is-docker": "2.2.1",
|
||||
|
||||
@ -40,7 +40,7 @@ module.exports = {
|
||||
|
||||
if (deletedFiles.length + deletedFolders.length > 1) {
|
||||
strapi.telemetry.send('didBulkDeleteMediaLibraryElements', {
|
||||
groupProperties: {
|
||||
eventProperties: {
|
||||
rootFolderNumber: deletedFolders.length,
|
||||
rootAssetNumber: deletedFiles.length,
|
||||
totalFolderNumber,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user