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:
@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user