Browse Source

Add type: m.login.application_service to register call

master
Alex 1 year ago
parent
commit
adf163bad5
Signed by: lx GPG Key ID: EDABF9711E244EB1
  1. 7
      .drone.yml
  2. 7
      mxlib/api.go
  3. 3
      mxlib/client.go

7
.drone.yml

@ -0,0 +1,7 @@
pipeline:
build:
image: golang:stretch
commands:
- go get -d -v
- go build -v

7
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 {

3
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

Loading…
Cancel
Save