From 71f9f7452d6e0f086f2377091f3e6cb66981f7a9 Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Tue, 18 Oct 2022 11:15:31 -0400 Subject: [PATCH] missed compiled file --- helpers/functions.api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/functions.api.js b/helpers/functions.api.js index 8b6b07bb..875aa14f 100644 --- a/helpers/functions.api.js +++ b/helpers/functions.api.js @@ -1,5 +1,5 @@ import fs from "node:fs/promises"; -import crypto from "node:crypto"; +import { v4 as uuidv4 } from "uuid"; import Debug from "debug"; const debug = Debug("lot-occupancy-system:functions.api"); const apiKeyPath = "data/apiKeys.json"; @@ -23,7 +23,7 @@ const saveApiKeys = async () => { } }; const generateApiKey = (apiKeyPrefix) => { - return apiKeyPrefix + "-" + crypto.randomUUID() + "-" + Date.now(); + return apiKeyPrefix + "-" + uuidv4() + "-" + Date.now(); }; export const regenerateApiKey = async (userName) => { apiKeys[userName] = generateApiKey(userName);