Browse Source

fix(onedrive): refresh token when expired

Gerald 9 years ago
parent
commit
77b5bc79d6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/background/sync/onedrive.js

+ 1 - 1
src/background/sync/onedrive.js

@@ -101,7 +101,7 @@ setTimeout(function () {
       .catch(function (res) {
         if (res.status === 404) {
           var header = res.getResponseHeader('WWW-Authenticate') || '';
-          if (/"invalid_token"/.test(header)) {
+          if (/^Bearer realm="OneDriveAPI"/.test(header)) {
             return _this.refreshToken().then(getMeta);
           } else {
             return {};