Skip to content

Commit

Permalink
Show error if config.json includes both googleAuth and refreshToken s…
Browse files Browse the repository at this point in the history
…ections.
  • Loading branch information
adriancable committed Nov 7, 2021
1 parent d0d2303 commit 128392f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ class NestPlatform {
throw('You did not specify your Nest account credentials {\'email\',\'password\'}, or an access_token, refreshToken, or googleAuth, in config.json');
}

if (this.config.googleAuth && this.config.refreshToken) {
throw('You have specified both googleAuth and refreshToken in config.json. Please pick the one you want to use, and remove the other one');
}

if (this.config.googleAuth && (!this.config.googleAuth.issueToken || !this.config.googleAuth.cookies)) { // || !this.config.googleAuth.apiKey)) {
throw('When using googleAuth, you must provide issueToken and cookies in config.json. Please see README.md for instructions');
}
Expand Down

0 comments on commit 128392f

Please sign in to comment.