From 328d31f5c7f5935995d878543c7e19d140f2c4df Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Fri, 25 Nov 2022 14:38:05 +0530 Subject: [PATCH] fix: allow sending device type during login --- package-lock.json | 4 ++-- package.json | 2 +- src/auth/index.ts | 3 ++- src/auth/types.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 127ca67..a75b6c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "frappe-js-sdk", - "version": "1.1.11", + "version": "1.1.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "frappe-js-sdk", - "version": "1.1.11", + "version": "1.1.12", "license": "MIT", "dependencies": { "axios": "^0.26.1" diff --git a/package.json b/package.json index f8cceb2..0a41278 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frappe-js-sdk", - "version": "1.1.11", + "version": "1.1.12", "description": "TypeScript/JavaScript client for Frappe Framework REST API", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/auth/index.ts b/src/auth/index.ts index 05d57f6..c6b1641 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -12,7 +12,7 @@ export class FrappeAuth { /** Logs in the user using username and password */ async loginWithUsernamePassword(credentials: AuthCredentials): Promise { - const { username, password } = credentials; + const { username, password, device } = credentials; const headers: AxiosRequestHeaders = { Accept: 'application/json', @@ -30,6 +30,7 @@ export class FrappeAuth { { usr: username, pwd: password, + device, }, { headers, diff --git a/src/auth/types.ts b/src/auth/types.ts index 243d72f..3254b5d 100644 --- a/src/auth/types.ts +++ b/src/auth/types.ts @@ -1,6 +1,7 @@ export interface AuthCredentials { username: string; password: string; + device?: string; } export interface AuthResponse {