diff --git a/service/src/storage/mongo.ts b/service/src/storage/mongo.ts index 2135cd08..54d1a5d0 100644 --- a/service/src/storage/mongo.ts +++ b/service/src/storage/mongo.ts @@ -355,7 +355,8 @@ export async function createUser(email: string, password: string, roles?: UserRo if (roles && roles.includes(UserRole.Admin)) userInfo.status = Status.Normal - if (status) + // Using `if (status !== null)` check because status.Normal value is 0, so `if (status)` would fail when status is Normal + if (status !== null) userInfo.status = status userInfo.roles = roles