From 903d53b01f2426a26d7a1795ca6285f1caf84fb9 Mon Sep 17 00:00:00 2001 From: Juniper Hovey Date: Tue, 9 Jan 2024 15:06:02 -0600 Subject: [PATCH] Fix mfa-less authentication --- .vscode/settings.json | 8 +++----- src/kwikset.ts | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 61de88b..5e1fbac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,10 @@ { "files.eol": "\n", "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, - "editor.rulers": [ - 100 - ], + "editor.rulers": [100], "eslint.enable": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true -} \ No newline at end of file +} diff --git a/src/kwikset.ts b/src/kwikset.ts index ef1d9d9..ca8543e 100644 --- a/src/kwikset.ts +++ b/src/kwikset.ts @@ -190,6 +190,9 @@ export const kwiksetLogin = async (config, log, api) => { const creds = await getCredentialsFromSession(await Auth.currentAuthenticatedUser()); fs.writeFileSync(kwiksetSavePath, JSON.stringify(creds)); log.debug('Credentials saved!'); + } else if (user.challengeName === undefined) { + log.info('No auth challenge, proceeding...'); + return true; } else { log.error(`Unknown auth challenge name ${user.challengeName}`); return false;