From 45048d50153e0c7760e331148d347b616941d0a7 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Mon, 30 Dec 2019 19:07:02 -0500 Subject: [PATCH] validate that emails look like emails --- lib/philomena_web/templates/pow/registration/edit.html.slime | 4 ++-- lib/philomena_web/templates/pow/registration/new.html.slime | 4 ++-- lib/philomena_web/templates/pow/session/new.html.slime | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/philomena_web/templates/pow/registration/edit.html.slime b/lib/philomena_web/templates/pow/registration/edit.html.slime index f6a475aa..f42b194e 100644 --- a/lib/philomena_web/templates/pow/registration/edit.html.slime +++ b/lib/philomena_web/templates/pow/registration/edit.html.slime @@ -35,7 +35,7 @@ p h3 Email address .field - = text_input f, :email, class: "input", placeholder: "Email", required: true + = text_input f, :email, class: "input", placeholder: "Email", required: true, pattern: ".*@.*" = error_tag f, :email h3 Change Password @@ -60,4 +60,4 @@ p .fieldlabel ' We need your current password to confirm all of these changes - = submit "Save Account", class: "button" \ No newline at end of file + = submit "Save Account", class: "button" diff --git a/lib/philomena_web/templates/pow/registration/new.html.slime b/lib/philomena_web/templates/pow/registration/new.html.slime index 69aa4201..4729517f 100644 --- a/lib/philomena_web/templates/pow/registration/new.html.slime +++ b/lib/philomena_web/templates/pow/registration/new.html.slime @@ -16,7 +16,7 @@ h1 Register ' You'll use your email address to log in, and we'll use this to get in ' touch if we need to. Don't worry, we won't share this or spam you. .field - = text_input f, :email, class: "input", placeholder: "Email", required: true + = text_input f, :email, class: "input", placeholder: "Email", required: true, pattern: ".*@.*" = error_tag f, :email .fieldlabel @@ -47,4 +47,4 @@ h1 Register br - = submit "Sign Up", class: "button" \ No newline at end of file + = submit "Sign Up", class: "button" diff --git a/lib/philomena_web/templates/pow/session/new.html.slime b/lib/philomena_web/templates/pow/session/new.html.slime index f9baa1aa..d9673999 100644 --- a/lib/philomena_web/templates/pow/session/new.html.slime +++ b/lib/philomena_web/templates/pow/session/new.html.slime @@ -8,7 +8,7 @@ h1 Sign in p = link "Forgot your password?", to: Routes.pow_reset_password_reset_password_path(@conn, :new) .field - = text_input f, :email, class: "input", required: true, placeholder: "Email", autofocus: true + = text_input f, :email, class: "input", required: true, placeholder: "Email", autofocus: true, pattern: ".*@.*" = error_tag f, :email .field