Add missing fullname for signup

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-25 23:24:52 +01:00
parent af23a3e605
commit 3ee3b37dac
3 changed files with 32 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ type (
RegisterUserParams struct {
Email string
Password string
FullName string
}
ErrInvalidCredentials struct {
@@ -95,8 +96,8 @@ func (s Service) RegisterUser(
ctx context.Context,
params RegisterUserParams,
) (*coredata.User, error) {
if params.Email == "" || params.Password == "" {
return nil, fmt.Errorf("email and password are required")
if params.Email == "" || params.Password == "" || params.FullName == "" {
return nil, fmt.Errorf("email, password, and full name are required")
}
// Use a high iteration count for password hashing
@@ -111,6 +112,7 @@ func (s Service) RegisterUser(
ID: gid.New(),
EmailAddress: params.Email,
HashedPassword: hashedPassword,
FullName: params.FullName,
CreatedAt: now,
UpdatedAt: now,
}