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,9 +40,14 @@ type LoginResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RegisterRequest struct {
|
type RegisterRequest struct {
|
||||||
|
Auth RegisterRequestAuth `json:"auth"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RegisterRequestAuth struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
}
|
||||||
|
|
||||||
type RegisterResponse struct {
|
type RegisterResponse struct {
|
||||||
UserId string `json:"user_id"`
|
UserId string `json:"user_id"`
|
||||||
AccessToken string `json:"access_token"`
|
AccessToken string `json:"access_token"`
|
||||||
|
|
|
@ -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