Skip to content

Commit 57d62e3

Browse files
fix: error when account.id is undefined (#932)
1 parent cff1802 commit 57d62e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/api/accounts/CreateAccount.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export const CreateAccount = (sendEmail: SendEmailTo, verifiedAccount: boolean,
2121
const usersController = new AccountsController(ctx.logger, verifiedAccount, pwnedCheckerRoot, sendEmail)
2222
const { email, password } = ctx.request.body
2323
const { account: { id, issuer }, token } = await usersController.create({ email, password })
24-
ctx.body = { id: bytesToUuid(id), issuer, token }
24+
ctx.body = { id: id && bytesToUuid(id), issuer, token }
2525
}

src/api/accounts/GetAccount.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ export const GetAccount = () => async (ctx: any, next: any): Promise<any> => {
2525
throw new AccountNotFound()
2626

2727
const { id, email, createdAt, name, bio, ethereumAddress } = response
28-
ctx.body = { id: bytesToUuid(id), email, createdAt, name, bio, ethereumAddress }
28+
ctx.body = { id: id && bytesToUuid(id), email, createdAt, name, bio, ethereumAddress }
2929
}

0 commit comments

Comments
 (0)