mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 01:03:10 -06:00
Fix duplicated user in ldap
This commit is contained in:
parent
813205af9a
commit
c2d4161bce
|
|
@ -105,7 +105,7 @@ func (t *LoginTypePassword) Login(ctx context.Context, req interface{}) (*Login,
|
||||||
JSON: jsonerror.InvalidUsername(err.Error()),
|
JSON: jsonerror.InvalidUsername(err.Error()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(sr.Entries) >= 1 {
|
if len(sr.Entries) > 1 {
|
||||||
return nil, &util.JSONResponse{
|
return nil, &util.JSONResponse{
|
||||||
Code: http.StatusUnauthorized,
|
Code: http.StatusUnauthorized,
|
||||||
JSON: jsonerror.BadJSON("'user' must be duplicated."),
|
JSON: jsonerror.BadJSON("'user' must be duplicated."),
|
||||||
|
|
@ -134,7 +134,6 @@ func (t *LoginTypePassword) Login(ctx context.Context, req interface{}) (*Login,
|
||||||
_, err = t.GetAccountByLocalpart(ctx, localpart)
|
_, err = t.GetAccountByLocalpart(ctx, localpart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
util.GetLogger(ctx).Debugf("registing user, %+v %+v", localpart, r.Password)
|
|
||||||
var accRes api.PerformAccountCreationResponse
|
var accRes api.PerformAccountCreationResponse
|
||||||
err = t.UserAPI.PerformAccountCreation(ctx, &api.PerformAccountCreationRequest{
|
err = t.UserAPI.PerformAccountCreation(ctx, &api.PerformAccountCreationRequest{
|
||||||
AppServiceID: "",
|
AppServiceID: "",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue