diff --git a/app/constants/apis.js b/app/constants/apis.js index 4abc2b46..e486ed8b 100644 --- a/app/constants/apis.js +++ b/app/constants/apis.js @@ -22,11 +22,11 @@ export const GENERATE_USERNAME_URL = ( sanitizedFirstname, sanitizedLastname, ) => { - return `${APPS.API_BACKEND}/users/username?dev=true&firstname=${sanitizedFirstname}&lastname=${sanitizedLastname}`; + return `${APPS.API_BACKEND}/users/username?dev=true&firstname=${encodeURIComponent(sanitizedFirstname)}&lastname=${encodeURIComponent(sanitizedLastname)}`; }; export const CHECK_USERNAME_AVAILABILITY = (userName) => { - return `${APPS.API_BACKEND}/users/isUsernameAvailable/${userName}`; + return `${APPS.API_BACKEND}/users/isUsernameAvailable/${encodeURIComponent(userName)}`; }; export const SELF_USERS_URL = `${APPS.API_BACKEND}/users/self`;