Skip to content

Commit

Permalink
fix refresh flow
Browse files Browse the repository at this point in the history
  • Loading branch information
SanterreJo committed Apr 12, 2024
1 parent 61ff118 commit 666d60e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/hiloApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,14 @@ const renewTokens = ({
async function login() {
getLogger().debug("Logging in");
const config = getConfig();
const newAccessToken = config.accessToken;
const newRefreshToken = config.refreshToken;
const expiresIn = config.expiresIn;
if (refreshToken === newRefreshToken) {
throw new Error(
"Unable to login. Please try to refresh your login credentials by using the 'Login with Hilo' button in the plugin configuration in homebridge UI"
);
}
renewTokens({
newAccessToken,
newRefreshToken,
expiresIn,
});
}

Expand Down

0 comments on commit 666d60e

Please sign in to comment.