Skip to content

Commit

Permalink
feat: zip the files, encrypt the zip file, upload
Browse files Browse the repository at this point in the history
This will make it easier for the end user to get all in one file vs multiple files. Will not remove the logic for multi file upload / download yet, but soon
  • Loading branch information
bjarneo committed Sep 8, 2022
1 parent c91e199 commit 6819962
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 5 deletions.
207 changes: 207 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"nanoid": "^3.1.31",
"pretty-bytes": "^4.0.2",
"redis": "^3.1.2",
"remove": "^0.1.5",
"replace-in-file": "^6.2.0",
"sanitize-filename": "^1.6.3",
"tweetnacl": "^0.14.5",
Expand All @@ -67,6 +68,8 @@
"husky": "^6.0.0",
"i18next": "^21.9.1",
"i18next-http-backend": "^1.4.1",
"jszip": "^3.10.1",
"jzip": "^1.0.0",
"lint-staged": "^11.0.0",
"mocha": "^9.0.0",
"nodemon": "^2.0.7",
Expand Down
7 changes: 5 additions & 2 deletions src/client/api/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ export const createSecret = async (formData = {}, token = '') => {
if (token) {
options.headers.authorization = `Bearer ${token}`;
}

try {
const data = await fetch(`${config.get('api.host')}/secret`, options);
const json = await data.json();

return { ...json, statusCode: data.status };
} catch (e) {
console.error(e);
} catch (error) {
console.error(error);

return { error: 'Failed to create your secret' };
}
};

Expand Down

0 comments on commit 6819962

Please sign in to comment.