diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index 3ac077705..9a79c50f2 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -81,7 +81,12 @@ func main() { logrus.Fatalln("Failed to connect to the database:", err.Error()) } - _, err = accountDB.CreateAccount(context.Background(), *username, pass, "") + policyVersion := "" + if cfg.Global.UserConsentOptions.Enabled() { + policyVersion = cfg.Global.UserConsentOptions.Version + } + + _, err = accountDB.CreateAccount(context.Background(), *username, pass, "", policyVersion) if err != nil { logrus.Fatalln("Failed to create the account:", err.Error()) } diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index 2476b5b20..6507505fe 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -60,14 +60,14 @@ func Setup( PathToResult: map[string]*types.ThumbnailGenerationResult{}, } - uploadHandler := httputil.MakeAuthAPI("upload", userAPI, cfg.Matrix.UserConsentOptions, func(req *http.Request, dev *userapi.Device) util.JSONResponse { + uploadHandler := httputil.MakeAuthAPI("upload", userAPI, cfg.Matrix.UserConsentOptions, false, func(req *http.Request, dev *userapi.Device) util.JSONResponse { if r := rateLimits.Limit(req); r != nil { return *r } return Upload(req, cfg, dev, db, activeThumbnailGeneration) }) - configHandler := httputil.MakeAuthAPI("config", userAPI, cfg.Matrix.UserConsentOptions, func(req *http.Request, device *userapi.Device) util.JSONResponse { + configHandler := httputil.MakeAuthAPI("config", userAPI, cfg.Matrix.UserConsentOptions, false, func(req *http.Request, device *userapi.Device) util.JSONResponse { if r := rateLimits.Limit(req); r != nil { return *r }