Add a method to validate email
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
@@ -105,3 +105,12 @@ func (a *PublicAccountService) SignUp(ctx context.Context, in *accounts.SignUpRe
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Check if an email is already used by an account
|
||||
func (a *PublicAccountService) IsEmailAvailable(ctx context.Context, in *accounts.IsEmailUsedRequest) (*accounts.IsEmailUsedResponse, error) {
|
||||
exists, err := a.accountsCtrl.IsExist(ctx, in.GetEmail())
|
||||
if err != nil {
|
||||
return nil, status.Error(codes.Aborted, "Couldn't check email availability")
|
||||
}
|
||||
return &accounts.IsEmailUsedResponse{Used: exists}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user