From bc0b0d03391b026daf45708add4ca563cc5ce795 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 12 Jul 2019 21:07:14 +0000 Subject: [PATCH] [next] Email/Password Improvements (#2400) * feat: improved some password/email fields - All secret fields are now "hidden" by default - All email fields now have autocomplete/spellcheck disabled with correct typings * feat: add additional email validation --- .../__snapshots__/resetPassword.spec.tsx.snap | 4 + .../sections/Auth/ClientSecretField.tsx | 11 +- .../Configure/sections/Auth/SSOKeyField.tsx | 11 +- .../sections/Moderation/APIKeyField.tsx | 11 +- .../createPassword.spec.tsx.snap | 20 + .../signInWithEmail.spec.tsx.snap | 24 ++ .../__snapshots__/auth.spec.tsx.snap | 400 +++++++++++++----- .../__snapshots__/moderation.spec.tsx.snap | 96 +++-- .../invite/__snapshots__/invite.spec.tsx.snap | 4 + .../client/auth/components/EmailField.tsx | 1 + .../addEmailAddress.spec.tsx.snap | 12 +- .../createPassword.spec.tsx.snap | 20 + .../test/__snapshots__/signIn.spec.tsx.snap | 54 ++- .../test/__snapshots__/signUp.spec.tsx.snap | 78 +++- .../PasswordField/PasswordField.css | 1 - .../PasswordField/PasswordField.tsx | 4 + .../__snapshots__/PasswordField.spec.tsx.snap | 8 + .../middleware/passport/strategies/local.ts | 15 +- 18 files changed, 584 insertions(+), 190 deletions(-) diff --git a/src/core/client/account/test/__snapshots__/resetPassword.spec.tsx.snap b/src/core/client/account/test/__snapshots__/resetPassword.spec.tsx.snap index 8d229091f..8ae501e8e 100644 --- a/src/core/client/account/test/__snapshots__/resetPassword.spec.tsx.snap +++ b/src/core/client/account/test/__snapshots__/resetPassword.spec.tsx.snap @@ -57,11 +57,15 @@ Make sure it is unique and be sure to keep it secure. className="PasswordField-wrapper" > diff --git a/src/core/client/admin/routes/Configure/sections/Auth/ClientSecretField.tsx b/src/core/client/admin/routes/Configure/sections/Auth/ClientSecretField.tsx index 982459287..8008e7c1a 100644 --- a/src/core/client/admin/routes/Configure/sections/Auth/ClientSecretField.tsx +++ b/src/core/client/admin/routes/Configure/sections/Auth/ClientSecretField.tsx @@ -4,7 +4,7 @@ import React, { FunctionComponent } from "react"; import { Field } from "react-final-form"; import { Validator } from "coral-framework/lib/validation"; -import { FormField, InputLabel, TextField } from "coral-ui/components"; +import { FormField, InputLabel, PasswordField } from "coral-ui/components"; import ValidationMessage from "../../ValidationMessage"; @@ -31,15 +31,14 @@ const ClientSecretField: FunctionComponent = ({ > {({ input, meta }) => ( <> - {meta.touched && (meta.error || meta.submitError) && ( diff --git a/src/core/client/admin/routes/Configure/sections/Auth/SSOKeyField.tsx b/src/core/client/admin/routes/Configure/sections/Auth/SSOKeyField.tsx index 34e506eda..86272d0b6 100644 --- a/src/core/client/admin/routes/Configure/sections/Auth/SSOKeyField.tsx +++ b/src/core/client/admin/routes/Configure/sections/Auth/SSOKeyField.tsx @@ -7,7 +7,7 @@ import { FormField, Icon, InputLabel, - TextField, + PasswordField, Typography, } from "coral-ui/components"; @@ -31,7 +31,14 @@ const SSOKeyField: FunctionComponent = ({ Key - +