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

@ -1,5 +1,4 @@
import { logger } from "@coder/logger"
import * as argon2 from "@node-rs/argon2"
import * as argon2 from "argon2"
import * as cp from "child_process"
import * as crypto from "crypto"
import envPaths from "env-paths"
@ -167,12 +166,7 @@ export const isHashMatch = async (password: string, hash: string) => {
if (password === "" || hash === "" || !hash.startsWith("$")) {
return false
}
try {
return await argon2.verify(hash, password)
} catch (error: any) {
logger.error(error)
return false
}
return await argon2.verify(hash, password)
}
/**