mirror of
https://github.com/bitwarden/browser
synced 2024-12-22 07:57:01 +01:00
Merge branch 'master' into browser-ext-ui-update-test
This commit is contained in:
commit
b8007102f9
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -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
|
||||
|
@ -2360,16 +2360,6 @@ 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();
|
||||
@ -2377,6 +2367,20 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user