Skip to content

Commit 6a4039a

Browse files
authored
Merge pull request #695 from inplayer-org/no-issue/encode-special-characters
Special characters problem with password and confirm password (setNewPassword method)
2 parents 796d75a + cd4fe94 commit 6a4039a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
# [3.11.1] - 26-04-2021
6+
7+
### Fixes
8+
9+
- Encode password and confirm password in setNewPassword method due to special characters problem
10+
511
# [3.11.0] - 11-03-2021
612

713
### Added

src/endpoints/account.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ class Account extends BaseExtend {
413413
async setNewPassword(data: SetNewPasswordData, token = '') {
414414
// TODO: check logic
415415
// eslint-disable-next-line max-len
416-
const body = `password=${data.password}&password_confirmation=${data.passwordConfirmation}&branding_id=${data.brandingId}`;
416+
const password = encodeURIComponent(data.password);
417+
const passwordConfirmation = encodeURIComponent(data.passwordConfirmation);
418+
const body = `password=${password}&password_confirmation=${passwordConfirmation}&branding_id=${data.brandingId}`;
417419

418420
return this.request.put(API.setNewPassword(token), body, {
419421
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },

0 commit comments

Comments
 (0)