We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd643dc commit 00224faCopy full SHA for 00224fa
src/node/util.ts
@@ -157,12 +157,7 @@ export const generatePassword = async (length = 24): Promise<string> => {
157
* Used to hash the password.
158
*/
159
export const hash = async (password: string): Promise<string> => {
160
- try {
161
- return await argon2.hash(password)
162
- } catch (error: any) {
163
- logger.error(error)
164
- return ""
165
- }
+ return await argon2.hash(password)
166
}
167
168
/**
test/unit/node/util.test.ts
@@ -104,6 +104,10 @@ describe("hash", () => {
104
const hashed = await util.hash(plainTextPassword)
105
expect(hashed).not.toBe(plainTextPassword)
106
})
107
+ it("should return a hash for an empty string", async () => {
108
+ const hashed = await util.hash("")
109
+ expect(hashed).not.toBe("")
110
+ })
111
112
113
describe("isHashMatch", () => {
0 commit comments