aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-08-08 11:23:13 +0300
committereug-vs <eug-vs@keemail.me>2020-08-08 11:23:13 +0300
commitf0a53feb38c5bbec8a94bbf4440a1ce184876013 (patch)
tree1b2cf3f70db2eaabd5d60734453958112d5d83b8 /src
parentf55374d5328f672dbce47e8d452ce17d02ced9f8 (diff)
downloadwhich-ui-f0a53feb38c5bbec8a94bbf4440a1ce184876013.tar.gz
feat: lowercase all username inputs
Diffstat (limited to 'src')
-rw-r--r--src/pages/LoginPage/LoginPage.tsx4
-rw-r--r--src/pages/RegistrationPage/RegistrationPage.tsx2
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) {