Archived
1
0

revert: @node-rs/argon2 -> node-argon2 (#4829)

* revert: partial revert of 723469ab5b

This reverts part of the changes introduced in refactor: migrate from argon2 ->
@node-rs/argon2 (#4733)

Switching to @node-rs/argon2 introduced bugs that we couldn't solve due to
limitations in npm.

see here
https://github.com/coder/code-server/issues/4804#issuecomment-1030338395
This commit is contained in:
Joe Previte
2022-02-04 15:52:42 -07:00
committed by GitHub
parent 00224fa73a
commit 25b1340771
8 changed files with 369 additions and 102 deletions

View File

@ -141,16 +141,16 @@ describe("isHashMatch", () => {
const actual = await util.isHashMatch(password, _hash)
expect(actual).toBe(false)
})
it("should return false if the hash doesn't start with a $", async () => {
it("should return false and not throw an error if the hash doesn't start with a $", async () => {
const password = "hellowpasssword"
const _hash = "n2i$v=19$m=4096,t=3,p=1$EAoczTxVki21JDfIZpTUxg$rkXgyrW4RDGoDYrxBFD4H2DlSMEhP4h+Api1hXnGnFY"
expect(async () => await util.isHashMatch(password, _hash)).not.toThrow()
expect(await util.isHashMatch(password, _hash)).toBe(false)
})
it("should return false if the password and hash don't match", async () => {
it("should reject the promise and throw if error", async () => {
const password = "hellowpasssword"
const _hash = "$ar2i"
const actual = await util.isHashMatch(password, _hash)
expect(actual).toBe(false)
expect(async () => await util.isHashMatch(password, _hash)).rejects.toThrow()
})
})