Skip to content

Commit 15c7ffb

Browse files
guguclaude
andcommitted
fix: wrap empty-password early return in Promise.resolve
hashUserPassword is declared to return Promise<string>, but the empty input early-exit returned the raw string and broke tsc. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b76ba10 commit 15c7ffb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/src/helpers/encryption/encryptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export class Encryptor {
305305
}
306306

307307
static hashUserPassword(password: string): Promise<string> {
308-
if (!password || password.length <= 0) return password;
308+
if (!password || password.length <= 0) return Promise.resolve(password);
309309
return new Promise<string>((resolve, reject) => {
310310
const salt = crypto.randomBytes(Constants.PASSWORD_SALT_LENGTH).toString(Constants.BYTE_TO_STRING_ENCODING);
311311
crypto.pbkdf2(

0 commit comments

Comments
 (0)