From: Roberto Morado Date: Tue, 14 Apr 2026 20:09:25 +0000 (-0400) Subject: Email auth X-Git-Url: https://git.morado.dev/?a=commitdiff_plain;h=acd94ae9091fa364c02660008849efaaf5aaef26;p=telluride.page Email auth --- 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 ?? "", }),