From df84a16b95103d742abb1adac4a41e84cfffe3b4 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Wed, 9 Nov 2022 10:59:03 -0800 Subject: [PATCH] Add external uuid to user create. --- pages/api/users/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/users/index.js b/pages/api/users/index.js index dc00dd75..b80e65d9 100644 --- a/pages/api/users/index.js +++ b/pages/api/users/index.js @@ -19,7 +19,7 @@ export default async (req, res) => { } if (req.method === 'POST') { - const { username, password } = req.body; + const { username, password, id } = req.body; const user = await getUser({ username }); @@ -28,7 +28,7 @@ export default async (req, res) => { } const created = await createUser({ - id: uuid(), + id: id || uuid(), username, password: hashPassword(password), });