Actual username on LoginTypePassword

This commit is contained in:
Daniel Aloni 2023-05-01 17:10:25 +03:00
parent 9c11562ea1
commit 866b70f023
2 changed files with 2 additions and 2 deletions

View file

@ -92,7 +92,7 @@ func (t *LoginTypePassword) Login(ctx context.Context, req interface{}) (*Login,
resp := jsonerror.InternalServerError() resp := jsonerror.InternalServerError()
return nil, &resp return nil, &resp
} }
username = res.Localpart username = "@" + res.Localpart + ":" + string(t.Config.Matrix.ServerName)
if username == "" { if username == "" {
return nil, &util.JSONResponse{ return nil, &util.JSONResponse{
Code: http.StatusUnauthorized, Code: http.StatusUnauthorized,

View file

@ -73,7 +73,7 @@ func Login(
return util.JSONResponse{ return util.JSONResponse{
Code: http.StatusOK, Code: http.StatusOK,
JSON: loginResponse{ JSON: loginResponse{
UserID: userutil.MakeUserID(login.Username(), cfg.Matrix.ServerName), UserID: login.User,
AccessToken: "", AccessToken: "",
HomeServer: cfg.Matrix.ServerName, HomeServer: cfg.Matrix.ServerName,
DeviceID: "", DeviceID: "",