use global id generator (#142)

* use global id generator

* remove duplicate `UserRemoved`

Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
Fabi
2020-05-28 13:28:36 +02:00
committed by GitHub
co-authored by Livio Amstutz
parent 2758bf30b1
commit e3f9e9c05e
18 changed files with 69 additions and 76 deletions
@@ -5,14 +5,14 @@ import (
"github.com/caos/logging"
"github.com/caos/zitadel/internal/crypto"
"github.com/caos/zitadel/internal/errors"
"github.com/caos/zitadel/internal/id"
"github.com/caos/zitadel/internal/project/model"
"github.com/sony/sonyflake"
"strings"
)
//ClientID random_number@projectname (eg. 495894098234@zitadel)
func generateNewClientID(idGenerator *sonyflake.Sonyflake, project *model.Project) (string, error) {
rndID, err := idGenerator.NextID()
func generateNewClientID(idGenerator id.Generator, project *model.Project) (string, error) {
rndID, err := idGenerator.Next()
if err != nil {
return "", err
}