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()
return nil, &resp
}
username = res.Localpart
username = "@" + res.Localpart + ":" + string(t.Config.Matrix.ServerName)
if username == "" {
return nil, &util.JSONResponse{
Code: http.StatusUnauthorized,

View file

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