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