Add type: m.login.application_service to register call
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
78b4037410
commit
adf163bad5
3 changed files with 16 additions and 1 deletions
7
.drone.yml
Normal file
7
.drone.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
pipeline:
|
||||||
|
build:
|
||||||
|
image: golang:stretch
|
||||||
|
commands:
|
||||||
|
- go get -d -v
|
||||||
|
- go build -v
|
||||||
|
|
|
@ -40,7 +40,12 @@ type LoginResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RegisterRequest 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 {
|
type RegisterResponse struct {
|
||||||
|
|
|
@ -144,6 +144,9 @@ func (mx *Client) PasswordLogin(username string, password string, device_id stri
|
||||||
|
|
||||||
func (mx *Client) RegisterUser(username string) error {
|
func (mx *Client) RegisterUser(username string) error {
|
||||||
req := RegisterRequest{
|
req := RegisterRequest{
|
||||||
|
Auth: RegisterRequestAuth{
|
||||||
|
Type: "m.login.application_service",
|
||||||
|
},
|
||||||
Username: username,
|
Username: username,
|
||||||
}
|
}
|
||||||
var rep RegisterResponse
|
var rep RegisterResponse
|
||||||
|
|
Loading…
Reference in a new issue