From a99393f7a652c28924782d079d8bec1420fb0cc5 Mon Sep 17 00:00:00 2001 From: nxshock Date: Sat, 20 Jul 2019 11:35:01 +0500 Subject: [PATCH] Update login method structures names --- internal/handlers.go | 2 +- internal/models/login/request.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/handlers.go b/internal/handlers.go index d152190..b140178 100644 --- a/internal/handlers.go +++ b/internal/handlers.go @@ -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 diff --git a/internal/models/login/request.go b/internal/models/login/request.go index b8360e0..7bbb529 100644 --- a/internal/models/login/request.go +++ b/internal/models/login/request.go @@ -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.