aboutsummaryrefslogtreecommitdiff
path: root/userapi/userapi.go
diff options
context:
space:
mode:
Diffstat (limited to 'userapi/userapi.go')
-rw-r--r--userapi/userapi.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/userapi/userapi.go b/userapi/userapi.go
index e91ce3a7..9174119e 100644
--- a/userapi/userapi.go
+++ b/userapi/userapi.go
@@ -42,12 +42,25 @@ func AddInternalRoutes(router *mux.Router, intAPI api.UserInternalAPI) {
// NewInternalAPI returns a concerete implementation of the internal API. Callers
// can call functions directly on the returned API or via an HTTP interface using AddInternalRoutes.
func NewInternalAPI(
- base *base.BaseDendrite, db storage.Database, cfg *config.UserAPI,
+ base *base.BaseDendrite, cfg *config.UserAPI,
appServices []config.ApplicationService, keyAPI keyapi.KeyInternalAPI,
rsAPI rsapi.RoomserverInternalAPI, pgClient pushgateway.Client,
) api.UserInternalAPI {
js, _ := jetstream.Prepare(base.ProcessContext, &cfg.Matrix.JetStream)
+ db, err := storage.NewUserAPIDatabase(
+ base,
+ &cfg.AccountDatabase,
+ cfg.Matrix.ServerName,
+ cfg.BCryptCost,
+ cfg.OpenIDTokenLifetimeMS,
+ api.DefaultLoginTokenLifetime,
+ cfg.Matrix.ServerNotices.LocalPart,
+ )
+ if err != nil {
+ logrus.WithError(err).Panicf("failed to connect to accounts db")
+ }
+
syncProducer := producers.NewSyncAPI(
db, js,
// TODO: user API should handle syncs for account data. Right now,