Skip to content

Commit

Permalink
fix: 400 error (#17528)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuran-deriv authored Nov 15, 2024
1 parent 32e16c3 commit 3c57d04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/bot-web-ui/src/stores/google-drive-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default class GoogleDriveStore {
this.setIsAuthorized(true);
localStorage.setItem('google_access_token', response.access_token);
this.setGoogleDriveTokenExpiry(response?.expires_in);
this.setGoogleDriveTokenValid(true);
}
},
});
Expand Down Expand Up @@ -137,8 +138,10 @@ export default class GoogleDriveStore {
async signOut() {
if (this.access_token) {
await window?.gapi?.client?.setToken({ access_token: '' });
await window?.google?.accounts?.oauth2?.revoke(this.access_token);
localStorage?.removeItem('google_access_token');
if (localStorage.getItem('google_access_token')) {
await window?.google?.accounts?.oauth2?.revoke(this.access_token);
localStorage?.removeItem('google_access_token');
}
this.access_token = '';
}
this.setIsAuthorized(false);
Expand Down

0 comments on commit 3c57d04

Please sign in to comment.