mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-11 19:58:05 -04:00
Allow email on auth queries
This commit is contained in:
@@ -122,9 +122,15 @@ func (s Service) ListAccounts(ctx context.Context, in *proto.ListAccountsRequest
|
||||
}
|
||||
|
||||
ids, err := s.index.FindBy(&proto.Account{}, "OnPremisesSamAccountName", match[1])
|
||||
if err != nil || len(ids) != 1 {
|
||||
if err != nil || len(ids) > 1 {
|
||||
return merrors.Unauthorized(s.id, "account not found or invalid credentials")
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
ids, err = s.index.FindBy(&proto.Account{}, "Mail", match[1])
|
||||
if err != nil || len(ids) != 1 {
|
||||
return merrors.Unauthorized(s.id, "account not found or invalid credentials")
|
||||
}
|
||||
}
|
||||
|
||||
a := &proto.Account{}
|
||||
err = s.repo.LoadAccount(ctx, ids[0], a)
|
||||
|
||||
Reference in New Issue
Block a user