Skip to content

Commit

Permalink
feat: authorize CloudLink access
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Mar 11, 2021
1 parent 93f8d6b commit 59dbbcf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
15 changes: 11 additions & 4 deletions app/assets/javascripts/ui_models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 59dbbcf

Please sign in to comment.