1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-23 00:25:04 +01:00

Merge branch 'master' into browser-ext-ui-update-test

This commit is contained in:
DanHillesheim 2022-10-31 13:02:27 -06:00
commit b8007102f9
2 changed files with 17 additions and 11 deletions

View File

@ -70,7 +70,9 @@ jobs:
steps: steps:
- name: Install gnome-keyring - name: Install gnome-keyring
if: ${{ matrix.os=='ubuntu-latest' }} 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 - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846

View File

@ -2360,16 +2360,6 @@ export class ApiService implements ApiServiceAbstraction {
tokenError: boolean, tokenError: boolean,
authed: boolean authed: boolean
): Promise<ErrorResponse> { ): Promise<ErrorResponse> {
if (
authed &&
((tokenError && response.status === 400) ||
response.status === 401 ||
response.status === 403)
) {
await this.logoutCallback(true);
return null;
}
let responseJson: any = null; let responseJson: any = null;
if (this.isJsonResponse(response)) { if (this.isJsonResponse(response)) {
responseJson = await response.json(); responseJson = await response.json();
@ -2377,6 +2367,20 @@ export class ApiService implements ApiServiceAbstraction {
responseJson = { Message: await response.text() }; 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); return new ErrorResponse(responseJson, response.status, tokenError);
} }