From a336c3a4dc04c6c909a0b071cdf313dd7591833e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Delattre?= Date: Sun, 13 Aug 2017 10:14:48 +0200 Subject: [PATCH] Trim username spaces while logging in --- src/public/js/actions/users.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/public/js/actions/users.js b/src/public/js/actions/users.js index a06de7c..686a951 100644 --- a/src/public/js/actions/users.js +++ b/src/public/js/actions/users.js @@ -14,7 +14,7 @@ export function loginUser(username, password) { configureAxios().post( "/users/login", { - username: username, + username: username.trim(), password: password, }, ), @@ -32,6 +32,10 @@ export function updateUser(config) { } export function userSignUp(config) { + if (config.username) { + config.username = config.username.trim(); + } + return request( "USER_SIGNUP", configureAxios().post("/users/signup", config), [