From 31026c731b6b30c8b4207fc2ab86edf3cca0acda Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 13 Jul 2021 20:31:28 -0700 Subject: Encode login form (fix #875) --- modern/src/components/registration/LoginForm.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modern/src') diff --git a/modern/src/components/registration/LoginForm.js b/modern/src/components/registration/LoginForm.js index e083541c..d8dc6967 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)); -- cgit v1.2.3