Skip to content

Commit 49972d8

Browse files
authored
fix: when auth proxy mode, init user status normal (#607)
Signed-off-by: Bob Du <i@bobdu.cc>
1 parent e9f4aad commit 49972d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

service/src/storage/mongo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ export async function createUser(email: string, password: string, roles?: UserRo
355355

356356
if (roles && roles.includes(UserRole.Admin))
357357
userInfo.status = Status.Normal
358-
if (status)
358+
// Using `if (status !== null)` check because status.Normal value is 0, so `if (status)` would fail when status is Normal
359+
if (status !== null)
359360
userInfo.status = status
360361

361362
userInfo.roles = roles

0 commit comments

Comments
 (0)