Fix password bugs (#2235)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2022-07-14 08:45:51 +06:00
committed by GitHub
parent e6aa55250a
commit 9645b5947e
15 changed files with 178 additions and 66 deletions
+14 -1
View File
@@ -23,9 +23,10 @@ import {
dropWorkspace,
getAccount,
getWorkspace,
setRole,
listAccounts,
listWorkspaces,
replacePassword,
setRole,
upgradeWorkspace
} from '@anticrm/account'
import { setMetadata } from '@anticrm/platform'
@@ -94,6 +95,18 @@ program
})
})
program
.command('reset-account <email>')
.description('create user and corresponding account in master database')
.option('-p, --password <password>', 'new user password')
.action(async (email: string, cmd) => {
const { mongodbUri } = prepareTools()
return await withDatabase(mongodbUri, async (db) => {
console.log(`update account ${email} ${cmd.first as string} ${cmd.last as string}...`)
await replacePassword(db, email, cmd.password)
})
})
program
.command('assign-workspace <email> <workspace>')
.description('assign workspace')