mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 03:31:41 +00:00
Fix account availability on register
This commit is contained in:
parent
8099bcbc8b
commit
0692be44d9
@ -776,12 +776,8 @@ func (a *UserInternalAPI) QueryNumericLocalpart(ctx context.Context, res *api.Qu
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *UserInternalAPI) QueryAccountAvailability(ctx context.Context, req *api.QueryAccountAvailabilityRequest, res *api.QueryAccountAvailabilityResponse) error {
|
func (a *UserInternalAPI) QueryAccountAvailability(ctx context.Context, req *api.QueryAccountAvailabilityRequest, res *api.QueryAccountAvailabilityResponse) error {
|
||||||
_, err := a.DB.CheckAccountAvailability(ctx, req.Localpart)
|
var err error
|
||||||
if err == sql.ErrNoRows {
|
res.Available, err = a.DB.CheckAccountAvailability(ctx, req.Localpart)
|
||||||
res.Available = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
res.Available = false
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user