diff options
author | eug-vs <eug-vs@keemail.me> | 2020-08-08 11:23:13 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-08-08 11:23:13 +0300 |
commit | f0a53feb38c5bbec8a94bbf4440a1ce184876013 (patch) | |
tree | 1b2cf3f70db2eaabd5d60734453958112d5d83b8 | |
parent | f55374d5328f672dbce47e8d452ce17d02ced9f8 (diff) | |
download | which-ui-f0a53feb38c5bbec8a94bbf4440a1ce184876013.tar.gz |
feat: lowercase all username inputs
-rw-r--r-- | src/pages/LoginPage/LoginPage.tsx | 4 | ||||
-rw-r--r-- | src/pages/RegistrationPage/RegistrationPage.tsx | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/pages/LoginPage/LoginPage.tsx b/src/pages/LoginPage/LoginPage.tsx index 2bc7e5a..335cbb1 100644 --- a/src/pages/LoginPage/LoginPage.tsx +++ b/src/pages/LoginPage/LoginPage.tsx @@ -49,11 +49,11 @@ const LoginPage: React.FC = () => { }; const handleSubmit = async () => { - const name = nameRef.current?.value; + const name = nameRef.current?.value?.toLowerCase(); const password = passwordRef.current?.value; if (name && password) { login(name, password, remember).then(success => { - if (success) history.push(`/profile/${login}`); + if (success) history.push(`/profile/${name}`); else setError(true); }); } diff --git a/src/pages/RegistrationPage/RegistrationPage.tsx b/src/pages/RegistrationPage/RegistrationPage.tsx index 8936c2d..829211d 100644 --- a/src/pages/RegistrationPage/RegistrationPage.tsx +++ b/src/pages/RegistrationPage/RegistrationPage.tsx @@ -43,7 +43,7 @@ const RegistrationPage: React.FC = () => { const history = useHistory(); const handleSubmit = () => { - const username = usernameRef.current?.value; + const username = usernameRef.current?.value?.toLowerCase(); const password = passwordRef.current?.value; const email = emailRef.current?.value; if (username && password) { |