From adf163bad564b16c7caefbdfb9ccfb9abac9fa97 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 1 Jun 2021 23:26:15 +0200 Subject: Add type: m.login.application_service to register call --- mxlib/api.go | 7 ++++++- mxlib/client.go | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'mxlib') diff --git a/mxlib/api.go b/mxlib/api.go index 6d35108..9cd02d5 100644 --- a/mxlib/api.go +++ b/mxlib/api.go @@ -40,7 +40,12 @@ type LoginResponse struct { } type RegisterRequest struct { - Username string `json:"username"` + Auth RegisterRequestAuth `json:"auth"` + Username string `json:"username"` +} + +type RegisterRequestAuth struct { + Type string `json:"type"` } type RegisterResponse struct { diff --git a/mxlib/client.go b/mxlib/client.go index c111360..689d3a0 100644 --- a/mxlib/client.go +++ b/mxlib/client.go @@ -144,6 +144,9 @@ func (mx *Client) PasswordLogin(username string, password string, device_id stri func (mx *Client) RegisterUser(username string) error { req := RegisterRequest{ + Auth: RegisterRequestAuth{ + Type: "m.login.application_service", + }, Username: username, } var rep RegisterResponse -- cgit v1.2.3