Skip to content

Commit

Permalink
revert file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Nov 1, 2022
1 parent a0ef655 commit 46eafaa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ jobs:
steps:
- name: Install gnome-keyring
if: ${{ matrix.os=='ubuntu-latest' }}
run: sudo apt-get install -y gnome-keyring dbus-x11
run: |
sudo apt-get update
sudo apt-get install -y gnome-keyring dbus-x11
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
Expand Down
24 changes: 14 additions & 10 deletions libs/common/src/services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2360,23 +2360,27 @@ export class ApiService implements ApiServiceAbstraction {
tokenError: boolean,
authed: boolean
): Promise<ErrorResponse> {
if (
authed &&
((tokenError && response.status === 400) ||
response.status === 401 ||
response.status === 403)
) {
await this.logoutCallback(true);
return null;
}

let responseJson: any = null;
if (this.isJsonResponse(response)) {
responseJson = await response.json();
} else if (this.isTextResponse(response)) {
responseJson = { Message: await response.text() };
}

if (authed) {
if (
response.status === 401 ||
response.status === 403 ||
(tokenError &&
response.status === 400 &&
responseJson != null &&
responseJson.error === "invalid_grant")
) {
await this.logoutCallback(true);
return null;
}
}

return new ErrorResponse(responseJson, response.status, tokenError);
}

Expand Down

0 comments on commit 46eafaa

Please sign in to comment.