Skip to content

Commit

Permalink
fix: trim secrets read as files in legacy API
Browse files Browse the repository at this point in the history
  • Loading branch information
benforshey committed Jan 17, 2024
1 parent 72bbd54 commit c5a4eca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/legacy-api/controllers/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ function fromSecretOrEnv(key) {
var SECRETS_DIR = '/run/secrets/'

if (fs.existsSync(SECRETS_DIR + key)) {
return fs.readFileSync(SECRETS_DIR + key).toString()
return fs
.readFileSync(SECRETS_DIR + key)
.toString()
.trim()
} else {
return process.env[key] || process.env[key.toUpperCase()]
}
Expand Down

0 comments on commit c5a4eca

Please sign in to comment.