Skip to content

Commit

Permalink
fix(miniapp): validate publicKey and add log, so on
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyiming0803 committed Jul 20, 2023
1 parent 0858a45 commit 6d8d965
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/miniapp/src/Authing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,22 @@ export class Authing {
}

const [error, publicKey] = await this.getPublicKey(
data.options?.passwordEncryptType
data.options.passwordEncryptType
)

if (error) {
return returnError(error)
}

if (typeof publicKey !== 'string') {
return returnError({
message: `publicKey of ${data.options.passwordEncryptType} is not a string, please contact the administrator`
})
}

data.passwordPayload.password = this.encryptFunction(
data.passwordPayload.password,
publicKey as string
publicKey
)
}

Expand Down

0 comments on commit 6d8d965

Please sign in to comment.