File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -157,12 +157,7 @@ export const generatePassword = async (length = 24): Promise<string> => {
157157 * Used to hash the password.
158158 */
159159export 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- }
160+ return await argon2 . hash ( password )
166161}
167162
168163/**
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ describe("hash", () => {
104104 const hashed = await util . hash ( plainTextPassword )
105105 expect ( hashed ) . not . toBe ( plainTextPassword )
106106 } )
107+ it ( "should return a hash for an empty string" , async ( ) => {
108+ const hashed = await util . hash ( "" )
109+ expect ( hashed ) . not . toBe ( "" )
110+ } )
107111} )
108112
109113describe ( "isHashMatch" , ( ) => {
You can’t perform that action at this time.
0 commit comments