From acd94ae9091fa364c02660008849efaaf5aaef26 Mon Sep 17 00:00:00 2001 From: Roberto Morado Date: Tue, 14 Apr 2026 16:09:25 -0400 Subject: [PATCH] Email auth --- src/application/usecases/register_user_use_case.ts | 3 ++- src/interfaces/http/views/home_page.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/application/usecases/register_user_use_case.ts b/src/application/usecases/register_user_use_case.ts index 50527c1..4e6d12d 100644 --- a/src/application/usecases/register_user_use_case.ts +++ b/src/application/usecases/register_user_use_case.ts @@ -10,7 +10,8 @@ export interface RegisterUserCommand { password: string; } -const USERNAME_PATTERN = /^[a-zA-Z0-9_]{3,20}$/; +const USERNAME_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; /** Email pattern */ +// const USERNAME_PATTERN = /^[a-zA-Z0-9_]{3,20}$/; export class RegisterUserUseCase { constructor( diff --git a/src/interfaces/http/views/home_page.ts b/src/interfaces/http/views/home_page.ts index fc1ae20..ff7cf42 100644 --- a/src/interfaces/http/views/home_page.ts +++ b/src/interfaces/http/views/home_page.ts @@ -208,9 +208,10 @@ const AuthPanel = ( }, [ h("label", null, [ - "Username", + "Email", h("input", { name: "username", + type: "email", required: true, minLength: 3, maxLength: 20, @@ -241,9 +242,10 @@ const AuthPanel = ( }, [ h("label", null, [ - "Username", + "Email", h("input", { name: "username", + type: "email", required: true, value: loginPrefill ?? "", }), -- 2.39.5