]> git.morado.dev Git - telluride.page/commitdiff
Email auth
authorRoberto Morado <roramigator@duck.com>
Tue, 14 Apr 2026 20:09:25 +0000 (16:09 -0400)
committerRoberto Morado <roramigator@duck.com>
Tue, 14 Apr 2026 20:09:25 +0000 (16:09 -0400)
src/application/usecases/register_user_use_case.ts
src/interfaces/http/views/home_page.ts

index 50527c18af084bac07134dd8d4671ca393338342..4e6d12dda993a0289891df08330df08272a01439 100644 (file)
@@ -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(
index fc1ae2087ef5be78dedc5b3bbddaf70da03d80bc..ff7cf428d8d49f45155485d89bfbc5b19c4e6472 100644 (file)
@@ -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 ?? "",
                       }),