Add a method to validate email
All checks were successful
ci/woodpecker/push/build Pipeline was successful

Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
2026-06-10 13:58:02 +02:00
parent 3ea6765486
commit 6e5e0fc805
5 changed files with 28 additions and 7 deletions

View File

@@ -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
}