File tree Expand file tree Collapse file tree 5 files changed +29
-5
lines changed Expand file tree Collapse file tree 5 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 321321 "message" : " Sign in" ,
322322 "description" : " Sign in to 3rd party storage services"
323323 },
324+ "sign_in_business" : {
325+ "message" : " Sign in (Business)" ,
326+ "description" : " Sign in to 3rd party storage services"
327+ },
328+ "onedrive_business_perms" : {
329+ "message" : " Why do business accounts require more permissions?"
330+ },
324331 "log_out" : {
325332 "message" : " Logout" ,
326333 "description" : " Sign out of 3rd party storage services"
Original file line number Diff line number Diff line change @@ -331,7 +331,9 @@ function getBackupToken(service: string) {
331331 redirUrl = encodeURIComponent ( chrome . identity . getRedirectURL ( ) ) ;
332332 authUrl = `https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=${
333333 getCredentials ( ) . onedrive . client_id
334- } &response_type=code&redirect_uri=${ redirUrl } &scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite.AppFolder%20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read%20offline_access&response_mode=query&prompt=consent`;
334+ } &response_type=code&redirect_uri=${ redirUrl } &scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite${
335+ localStorage . oneDriveBusiness !== "true" ? ".AppFolder" : ""
336+ } %20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read%20offline_access&response_mode=query&prompt=consent`;
335337 }
336338 chrome . identity . launchWebAuthFlow (
337339 { url : authUrl , interactive : true } ,
@@ -459,7 +461,11 @@ function getBackupToken(service: string) {
459461 xhr . send (
460462 `client_id=${
461463 getCredentials ( ) . onedrive . client_id
462- } &grant_type=authorization_code&scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite.AppFolder%20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read%20offline_access&code=${ value } &redirect_uri=${ redirUrl } &client_secret=${ encodeURIComponent (
464+ } &grant_type=authorization_code&scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite${
465+ localStorage . oneDriveBusiness !== "true"
466+ ? ".AppFolder"
467+ : ""
468+ } %20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read%20offline_access&code=${ value } &redirect_uri=${ redirUrl } &client_secret=${ encodeURIComponent (
463469 getCredentials ( ) . onedrive . client_secret
464470 ) } `
465471 ) ;
Original file line number Diff line number Diff line change 2626 <a-button v-show =" !backupToken" @click =" getBackupToken()" >
2727 {{ i18n.sign_in }}
2828 </a-button >
29+ <a-button v-show =" !backupToken" @click =" getBackupToken(true)" >
30+ {{ i18n.sign_in_business }}
31+ </a-button >
32+ <div class =" text" v-show =" !backupToken" >
33+ <a href =" https://authenticator.cc/docs/en/onedrive-perms" >{{
34+ i18n.onedrive_business_perms
35+ }}</a >
36+ </div >
2937 <a-button v-show =" backupToken" @click =" backupUpload()" >
3038 {{ i18n.manual_dropbox }}
3139 </a-button >
@@ -67,7 +75,8 @@ export default Vue.extend({
6775 },
6876 },
6977 methods: {
70- getBackupToken() {
78+ getBackupToken(business ? : boolean ) {
79+ localStorage .oneDriveBusiness = Boolean (business );
7180 chrome .runtime .sendMessage ({ action: service });
7281 },
7382 async backupLogout() {
Original file line number Diff line number Diff line change @@ -538,7 +538,9 @@ export class OneDrive implements BackupProvider {
538538 localStorage . oneDriveRefreshToken
539539 } &client_secret=${ encodeURIComponent (
540540 getCredentials ( ) . onedrive . client_secret
541- ) } &grant_type=refresh_token&scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite.AppFolder%20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read%20offline_access`
541+ ) } &grant_type=refresh_token&scope=https%3A%2F%2Fgraph.microsoft.com%2FFiles.ReadWrite${
542+ localStorage . oneDriveBusiness !== "true" ? ".AppFolder" : ""
543+ } %20https%3A%2F%2Fgraph.microsoft.com%2FUser.Read%20offline_access`
542544 ) ;
543545 }
544546 ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export class Backup implements Module {
2424 break ;
2525
2626 case "onedrive" :
27- state . driveToken = args . value ;
27+ state . oneDriveToken = args . value ;
2828 break ;
2929
3030 default :
You can’t perform that action at this time.
0 commit comments