From a1e4b8565b2f050e0a5d01de825545052e13a460 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Tue, 4 Apr 2023 08:56:49 +0300 Subject: [PATCH] 1.2.4 - Password encoding at login. --- README.md | 3 ++- package-lock.json | 4 ++-- package.json | 2 +- src/client.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b8b6819..e6390b7 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,5 @@ All tests in the package can be executed by running: `npm test`. 1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API. 1.2.1 - Added decodeToken function. The token is obtained directly by the function from local storage. If the token is missing, the function returns null. 1.2.2 - Upgraded @flare/js-utils package. -1.2.3 - Added user group and role types after enriching the "user-info" result. +1.2.3 - Added user group and role types after enriching the "user-info" result. +1.2.4 - Password encoding at login. diff --git a/package-lock.json b/package-lock.json index ab90c20..f3b9f9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@flare/tuitio-client", - "version": "1.2.3", + "version": "1.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@flare/tuitio-client", - "version": "1.2.3", + "version": "1.2.4", "license": "MIT", "dependencies": { "@flare/js-utils": "^1.1.0", diff --git a/package.json b/package.json index 065a473..af03fbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@flare/tuitio-client", - "version": "1.2.3", + "version": "1.2.4", "description": "Tuitio client is an npm package written in typescript that facilitates the integration of a javascript application with Tuitio.", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/client.ts b/src/client.ts index bf6ddf6..db819e5 100644 --- a/src/client.ts +++ b/src/client.ts @@ -24,7 +24,7 @@ class TuitioClient { } async login(userName: string, password: string): Promise { - const url = this.urlTemplates.login.replace("{username}", userName).replace("{password}", password); + const url = this.urlTemplates.login.replace("{username}", userName).replace("{password}", encodeURIComponent(password)); const response = await request(url, "post"); if (!response.error) {