feat: authorize CloudLink access

This commit is contained in:
Baptiste Grob 2021-03-11 15:41:29 +01:00
parent 93f8d6bbe7
commit 59dbbcf6fd
No known key found for this signature in database
GPG key ID: 4CC6BD922C8AF137
3 changed files with 16 additions and 9 deletions

View file

@ -204,10 +204,17 @@ export class WebApplication extends SNApplication {
}
async openModalComponent(component: SNComponent): Promise<void> {
if (component.package_info?.identifier === "org.standardnotes.batch-manager") {
if (!await this.authorizeBatchManagerAccess()) {
return;
}
switch (component.package_info?.identifier) {
case 'org.standardnotes.batch-manager':
if (!await this.authorizeBatchManagerAccess()) {
return;
}
break;
case 'org.standardnotes.cloudlink':
if (!await this.authorizeCloudLinkAccess()) {
return;
}
break;
}
const scope = this.scope!.$new(true) as Partial<ComponentModalScope>;
scope.componentUuid = component.uuid;

View file

@ -68,7 +68,7 @@
"@reach/alert-dialog": "^0.13.0",
"@reach/dialog": "^0.13.0",
"@standardnotes/sncrypto-web": "^1.2.10",
"@standardnotes/snjs": "^2.0.67",
"@standardnotes/snjs": "^2.0.69",
"mobx": "^6.1.6",
"preact": "^10.5.12"
}

View file

@ -1850,10 +1850,10 @@
"@standardnotes/sncrypto-common" "^1.2.7"
libsodium-wrappers "^0.7.8"
"@standardnotes/snjs@^2.0.67":
version "2.0.67"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.0.67.tgz#87e29f40bb5efaa36f30ddc5905164f7dce194d9"
integrity sha512-XCDxlFQCh0zmV3Hc9mjU7ritZ/2Ma5JPoCbDy4CIAlkKdmVL4tu/4jCfRFILM0zpKF/kLsCTbLGdG7TgU/ReKg==
"@standardnotes/snjs@^2.0.69":
version "2.0.69"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.0.69.tgz#8bb5184547673442555bd07a33b998b85117885c"
integrity sha512-S+7ozn+Xi2BAKZE1yM0wWHPLXOR4wAqUomZRU0jP1SK8XJwb2XMUKhM84wSK2AOfFDTvONzeqC5/lAK9ZXT+Sw==
dependencies:
"@standardnotes/auth" "^2.0.0"
"@standardnotes/sncrypto-common" "^1.2.9"