owner_new.go: perform email check before processing
This commit is contained in:
parent
c6a98d93e4
commit
00c197e2ee
@ -16,6 +16,10 @@ func ownerNew(email string, name string, password string) (string, error) {
|
|||||||
return "", errorNewOwnerForbidden
|
return "", errorNewOwnerForbidden
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := ownerGetByEmail(email); err == nil {
|
||||||
|
return "", errorEmailAlreadyExists
|
||||||
|
}
|
||||||
|
|
||||||
ownerHex, err := randomHex(32)
|
ownerHex, err := randomHex(32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("cannot generate ownerHex: %v", err)
|
logger.Errorf("cannot generate ownerHex: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user