Skip to content

Commit

Permalink
Removed Cast bcrypt to integer when reading from .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
nabil-nablotech committed Dec 29, 2023
1 parent 93c473b commit 2509e84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Backend/src/database/database.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DatabaseService {
name: process.env.CSD_USER,
password: bcrypt.hashSync(
process.env.CSD_PASSWORD,
parseInt(process.env.BCRYPT_SALT),
process.env.BCRYPT_SALT,
),
});
}
Expand All @@ -52,7 +52,7 @@ export class DatabaseService {
$set: {
password: bcrypt.hashSync(
process.env.CSD_PASSWORD,
parseInt(process.env.BCRYPT_SALT),
process.env.BCRYPT_SALT,
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion Backend/src/login/login.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class LoginService {
// console.log(bcrypt.hashSync(user.password, process.env.BCRYPT_SALT));
const encryptedUser = {
name: user.name,
password: bcrypt.hashSync(user.password, parseInt(process.env.BCRYPT_SALT)),
password: bcrypt.hashSync(user.password, process.env.BCRYPT_SALT),
};

// this should not throw an error, then the return is executed
Expand Down

0 comments on commit 2509e84

Please sign in to comment.