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,15 @@ func (c *AccountController) Login(ctx context.Context, email, password string) (
|
||||
|
||||
return uuid, nil
|
||||
}
|
||||
|
||||
func (c *AccountController) IsExist(ctx context.Context, email string) (bool, error) {
|
||||
log := logger.FromContext(ctx)
|
||||
log.V(2).Info("Checking if an account with email exists")
|
||||
|
||||
exists, err := repository.IsAccountExist(ctx, c.DB, email)
|
||||
if err != nil {
|
||||
return false, ErrServerError
|
||||
}
|
||||
|
||||
return exists, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user