diff options
author | Pika <15848969+ThatNerdyPikachu@users.noreply.github.com> | 2020-10-20 06:47:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 11:47:37 +0100 |
commit | 53a745f3332c4bb35dddd80ff8f83e7eb11456ca (patch) | |
tree | fd18ad6131d0d7993564d9a23be4724fe487cb6e /cmd | |
parent | eb86e2b336e8feaf54eb7fe688c896aa11bd5329 (diff) |
fix create-account (#1546)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/create-account/main.go | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index a9bd9279..f6de2d0d 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -22,7 +22,6 @@ import ( "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/userapi/storage/accounts" - "github.com/matrix-org/dendrite/userapi/storage/devices" "github.com/matrix-org/gomatrixserverlib" ) @@ -39,7 +38,6 @@ var ( username = flag.String("username", "", "The user ID localpart to register e.g 'alice' in '@alice:localhost'.") password = flag.String("password", "", "Optional. The password to register with. If not specified, this account will be password-less.") serverNameStr = flag.String("servername", "localhost", "The Matrix server domain which will form the domain part of the user ID.") - accessToken = flag.String("token", "", "Optional. The desired access_token to have. If not specified, a random access_token will be made.") ) func main() { @@ -78,29 +76,5 @@ func main() { os.Exit(1) } - deviceDB, err := devices.NewDatabase(&config.DatabaseOptions{ - ConnectionString: config.DataSource(*database), - }, serverName) - if err != nil { - fmt.Println(err.Error()) - os.Exit(1) - } - - if *accessToken == "" { - t := "token_" + *username - accessToken = &t - } - - device, err := deviceDB.CreateDevice( - context.Background(), *username, nil, *accessToken, nil, "127.0.0.1", "", - ) - if err != nil { - fmt.Println(err.Error()) - os.Exit(1) - } - - fmt.Println("Created account:") - fmt.Printf("user_id = %s\n", device.UserID) - fmt.Printf("device_id = %s\n", device.ID) - fmt.Printf("access_token = %s\n", device.AccessToken) + fmt.Println("Created account") } |