File tree 2 files changed +5
-6
lines changed
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> => {
157
157
* Used to hash the password.
158
158
*/
159
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
- }
160
+ return await argon2 . hash ( password )
166
161
}
167
162
168
163
/**
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ describe("hash", () => {
104
104
const hashed = await util . hash ( plainTextPassword )
105
105
expect ( hashed ) . not . toBe ( plainTextPassword )
106
106
} )
107
+ it ( "should return a hash for an empty string" , async ( ) => {
108
+ const hashed = await util . hash ( "" )
109
+ expect ( hashed ) . not . toBe ( "" )
110
+ } )
107
111
} )
108
112
109
113
describe ( "isHashMatch" , ( ) => {
You can’t perform that action at this time.
0 commit comments