Skip to content

Commit

Permalink
Merge pull request #16 from Alchez/fix-allow-device-login
Browse files Browse the repository at this point in the history
fix: allow sending device type during login
  • Loading branch information
nikkothari22 authored Nov 27, 2022
2 parents 9abbe30 + 328d31f commit 0d813d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class FrappeAuth {

/** Logs in the user using username and password */
async loginWithUsernamePassword(credentials: AuthCredentials): Promise<AuthResponse> {
const { username, password } = credentials;
const { username, password, device } = credentials;

const headers: AxiosRequestHeaders = {
Accept: 'application/json',
Expand All @@ -30,6 +30,7 @@ export class FrappeAuth {
{
usr: username,
pwd: password,
device,
},
{
headers,
Expand Down
1 change: 1 addition & 0 deletions src/auth/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface AuthCredentials {
username: string;
password: string;
device?: string;
}

export interface AuthResponse {
Expand Down

0 comments on commit 0d813d6

Please sign in to comment.