From 2a5f22a483bb95e33f7224785981230701c1c2e9 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Thu, 16 Feb 2023 08:09:49 +0100 Subject: [PATCH] fix: fix new user when it already exists --- src/routes/route-utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/route-utils.ts b/src/routes/route-utils.ts index 70bd328..8474a74 100644 --- a/src/routes/route-utils.ts +++ b/src/routes/route-utils.ts @@ -130,5 +130,7 @@ export async function getUser(req: express.Request) { httpStatus: 401, }); } - return new User(new UserModel(user)); + const model = new UserModel(user); + model.isNew = false; + return new User(model); }