Update login method structures names

This commit is contained in:
nxshock 2019-07-20 11:35:01 +05:00
parent 32637e5c37
commit a99393f7a6
2 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ func LoginHandler(w http.ResponseWriter, r *http.Request) {
// https://models.org/docs/spec/client_server/latest#post-models-client-r0-login
case "POST":
{
var request login.LoginRequest
var request login.PostRequest
getRequest(r, &request) // TODO: handle error
// delete start "@" if presents

View File

@ -4,9 +4,9 @@ import (
common "github.com/nxshock/signaller/internal/models/common"
)
// LoginRequest represents login request
// https://matrix.org/docs/spec/client_server/r0.4.0.html#post-matrix-client-r0-login
type LoginRequest struct {
// PostRequest represents POST login request
// https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-login
type PostRequest struct {
Type common.AuthenticationType `json:"type"` // Required. The login type being used. One of: ["m.login.password", "m.login.token"]
Identifier common.UserIdentifier `json:"identifier"` // Identification information for the user.
Password string `json:"password,omitempty"` // Required when type is m.login.password. The user's password.