aboutsummaryrefslogtreecommitdiff
path: root/mxlib
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-06-01 23:26:15 +0200
committerAlex Auvolat <alex@adnab.me>2021-06-01 23:26:15 +0200
commitadf163bad564b16c7caefbdfb9ccfb9abac9fa97 (patch)
tree8fc0508d90c7469685bd049372de2916a4165e7f /mxlib
parent78b40374105633fe908a8bf2f556a92a370fbfa1 (diff)
downloadeasybridge-adf163bad564b16c7caefbdfb9ccfb9abac9fa97.tar.gz
easybridge-adf163bad564b16c7caefbdfb9ccfb9abac9fa97.zip
Add type: m.login.application_service to register call
Diffstat (limited to 'mxlib')
-rw-r--r--mxlib/api.go7
-rw-r--r--mxlib/client.go3
2 files changed, 9 insertions, 1 deletions
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