Skip to content

Commit a83b398

Browse files
new password in configuration file
1 parent df65d97 commit a83b398

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

CWE-256/main.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
const main = async () => {
2-
const user = { username: 'admin', password: 'password1234' }
1+
const DB_PASSWORD = 'password1234'
32

4-
const response = await fetch('/api', {
5-
method: 'POST',
6-
headers: {
7-
'Content-Type': 'application/json',
8-
},
9-
body: JSON.stringify({ username: user }),
10-
})
3+
const main = () => {
4+
const dbConfig = {
5+
host: 'localhost',
6+
user: 'admin',
7+
password: DB_PASSWORD,
8+
}
119

12-
return response.json()
10+
connectToDataBase(dbConfig)
11+
}
12+
13+
const connectToDataBase = (dbConfig) => {
14+
console.log(`Connecting with ${dbConfig}`)
1315
}

0 commit comments

Comments
 (0)