mirror of
https://github.com/louislam/dockge.git
synced 2024-11-27 21:24:02 +00:00
Update reset-password.ts
You can use a variable in order to set password value : docker exec -e PASSWORD=value -it dockge npm run reset-password and you still have the standard behavior when no PASSWORD provided : docker exec -it dockge npm run reset-password
This commit is contained in:
parent
4a9173f5dc
commit
4fe1625f8d
1 changed files with 15 additions and 3 deletions
|
@ -38,9 +38,21 @@ export const main = async () => {
|
|||
|
||||
console.log("Found user: " + user.username);
|
||||
|
||||
let password = "";
|
||||
let confirmPassword = " ";
|
||||
|
||||
while (true) {
|
||||
let password = await question("New Password: ");
|
||||
let confirmPassword = await question("Confirm New Password: ");
|
||||
if (process.env.PASSWORD) {
|
||||
console.log("Found password : " + process.env.PASSWORD) ;
|
||||
password = process.env.PASSWORD ;
|
||||
confirmPassword = process.env.PASSWORD ;
|
||||
} else {
|
||||
console.log("No found password: " ) ;
|
||||
password = await question("New Password: ");
|
||||
confirmPassword = await question("Confirm New Password: ");
|
||||
}
|
||||
|
||||
// console.log("Password to be set :" + password);
|
||||
|
||||
if (password === confirmPassword) {
|
||||
await User.resetPassword(user.id, password);
|
||||
|
|
Loading…
Reference in a new issue