aboutsummaryrefslogtreecommitdiff
path: root/cmd/create-account
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-02-18 11:31:05 +0000
committerGitHub <noreply@github.com>2022-02-18 11:31:05 +0000
commit153bfbbea579dfa10e8e804036f17c1a33b6fe80 (patch)
treee135dcefc59618d7b86cd8687c1a2a304385ce45 /cmd/create-account
parent0a7dea44505f703af1e7e069602ca95aa5a83700 (diff)
Merge both user API databases into one (#2186)
* Merge user API databases into one * Remove DeviceDatabase from config * Fix tests * Try that again * Clean up keyserver device keys when the devices no longer exist in the user API * Tweak ordering * Fix UserExists flag, device check * Allow including empty entries so we can clean them up * Remove logging
Diffstat (limited to 'cmd/create-account')
-rw-r--r--cmd/create-account/main.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go
index d9202eb0..3003896c 100644
--- a/cmd/create-account/main.go
+++ b/cmd/create-account/main.go
@@ -30,7 +30,7 @@ import (
"github.com/matrix-org/dendrite/setup"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/userapi/api"
- "github.com/matrix-org/dendrite/userapi/storage/accounts"
+ userdb "github.com/matrix-org/dendrite/userapi/storage"
)
const usage = `Usage: %s
@@ -77,9 +77,14 @@ func main() {
pass := getPassword(password, pwdFile, pwdStdin, askPass, os.Stdin)
- accountDB, err := accounts.NewDatabase(&config.DatabaseOptions{
- ConnectionString: cfg.UserAPI.AccountDatabase.ConnectionString,
- }, cfg.Global.ServerName, bcrypt.DefaultCost, cfg.UserAPI.OpenIDTokenLifetimeMS)
+ accountDB, err := userdb.NewDatabase(
+ &config.DatabaseOptions{
+ ConnectionString: cfg.UserAPI.AccountDatabase.ConnectionString,
+ },
+ cfg.Global.ServerName, bcrypt.DefaultCost,
+ cfg.UserAPI.OpenIDTokenLifetimeMS,
+ api.DefaultLoginTokenLifetime,
+ )
if err != nil {
logrus.Fatalln("Failed to connect to the database:", err.Error())
}