Skip to content

Commit

Permalink
fix: add missing productId to getAccountInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
  • Loading branch information
aonnikov committed May 8, 2024
1 parent 6c2fdb5 commit e941022
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/account/src/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function toAccountInfo (account: Account): AccountInfo {
return result
}

async function getAccountInfo (ctx: MeasureContext, db: Db, email: string, password: string): Promise<AccountInfo> {
async function getAccountInfo (ctx: MeasureContext, db: Db, productId: string, email: string, password: string): Promise<AccountInfo> {
const account = await getAccount(db, email)
if (account === null) {
throw new PlatformError(new Status(Severity.ERROR, platform.status.AccountNotFound, { account: email }))
Expand Down Expand Up @@ -285,7 +285,7 @@ export async function login (
): Promise<LoginInfo> {
const email = cleanEmail(_email)
try {
const info = await getAccountInfo(ctx, db, email, password)
const info = await getAccountInfo(ctx, db, productId, email, password)
const result = {
endpoint: getEndpoint(),
email,
Expand Down Expand Up @@ -1496,7 +1496,7 @@ export async function changePassword (
password: string
): Promise<void> {
const { email } = decodeToken(token)
const account = await getAccountInfo(ctx, db, email, oldPassword)
const account = await getAccountInfo(ctx, db, productId, email, oldPassword)

const salt = randomBytes(32)
const hash = hashWithSalt(password, salt)
Expand Down

0 comments on commit e941022

Please sign in to comment.