Skip to content

Commit

Permalink
feat: error message for bad credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawiizz committed May 26, 2023
1 parent a599a2a commit 97bfc93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export const LibreLinkUpClient = ({
password,
});

if (loginResponse.data.status !== 200) throw new Error('Bad credentials. Please ensure that you have entered the credentials of your LibreLinkUp account (and not of your LibreLink account).');

if ((loginResponse.data as LoginRedirectResponse).data.redirect) {
const redirectResponse = loginResponse.data as LoginRedirectResponse;
const countryNodes = await instance.get<CountryResponse>(
Expand Down

0 comments on commit 97bfc93

Please sign in to comment.