fix: handle duplicate input
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func (a *AuthSvc) RegisterStaff(spec authdomain.RegisterStaffReq) (string, error) {
|
||||
_, err := a.staffRepo.GetStaffByEmail(spec.Email)
|
||||
if err == nil {
|
||||
return "", errors.New("this email address is already in use")
|
||||
}
|
||||
hashedPwd, err := HashPassword(spec.Password)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user