Skip to content

Commit cb49a61

Browse files
fix(setup): per-key reason in the secret-replacement warning
Cursor: the warn hardcoded '64-character hex key', but only ENCRYPTION_KEY/API_ENCRYPTION_KEY require that — BETTER_AUTH_SECRET/INTERNAL_API_SECRET only need length >= 32. Use the existing secretRequirement(key) helper so each replaced key reports its actual requirement.
1 parent fd1a900 commit cb49a61

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/setup/steps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
isTruthy,
88
isUsableSecret,
99
SECRET_KEYS,
10+
secretRequirement,
1011
} from './env-files.ts'
1112
import * as p from './prompter.ts'
1213
import { link, theme } from './theme.ts'
@@ -30,9 +31,8 @@ export function collectSecrets(existing: EnvFile): Record<string, string> {
3031
}
3132
}
3233
if (replaced.length > 0) {
33-
p.log.warn(
34-
`Replaced ${replaced.join(', ')} — the existing value is not a 64-character hex key, which the app rejects at runtime.`
35-
)
34+
const detail = replaced.map((key) => `${key} (${secretRequirement(key)})`).join(', ')
35+
p.log.warn(`Replaced ${detail} — the app rejects the existing value at runtime.`)
3636
}
3737
if (generated.length > 0) {
3838
p.log.step(`Generated ${generated.join(', ')}`)

0 commit comments

Comments
 (0)