Add type: m.login.application_service to register call
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Alex 2021-06-01 23:26:15 +02:00
parent 78b4037410
commit adf163bad5
No known key found for this signature in database
GPG key ID: EDABF9711E244EB1
3 changed files with 16 additions and 1 deletions

7
.drone.yml Normal file
View file

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

View file

@ -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"`

View file

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