aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-07-13 20:31:28 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-07-13 20:31:28 -0700
commit31026c731b6b30c8b4207fc2ab86edf3cca0acda (patch)
tree6435c2a0a55676286a11d9d6322c0218549de4cb
parent13a16a9ce640060b87ee00955c99855e9e4e2fe2 (diff)
downloadetbsa-traccar-web-31026c731b6b30c8b4207fc2ab86edf3cca0acda.tar.gz
etbsa-traccar-web-31026c731b6b30c8b4207fc2ab86edf3cca0acda.tar.bz2
etbsa-traccar-web-31026c731b6b30c8b4207fc2ab86edf3cca0acda.zip
Encode login form (fix #875)
-rw-r--r--modern/src/components/registration/LoginForm.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/components/registration/LoginForm.js b/modern/src/components/registration/LoginForm.js
index e083541..d8dc696 100644
--- a/modern/src/components/registration/LoginForm.js
+++ b/modern/src/components/registration/LoginForm.js
@@ -41,7 +41,10 @@ const LoginForm = () => {
const handleLogin = async (event) => {
event.preventDefault();
- const response = await fetch('/api/session', { method: 'POST', body: new URLSearchParams(`email=${email}&password=${password}`) });
+ const response = await fetch('/api/session', {
+ method: 'POST',
+ body: new URLSearchParams(`email=${encodeURIComponent(email)}&password=${encodeURIComponent(password)}`)
+ });
if (response.ok) {
const user = await response.json();
dispatch(sessionActions.updateUser(user));