Skip to content

Commit

Permalink
dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Jun 6, 2024
1 parent 917fedc commit 847ecc4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions frontend/src/components/ManageSetupCode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import { ClipboardIcon, EyeIcon, EyeSlashIcon } from '@heroicons/vue/20/solid';
import { nextTick, onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { JWE, Recipient } from '../common/jwe';
import userdata from '../common/userdata';
import { debounce } from '../common/util';
import FetchError from './FetchError.vue';
Expand All @@ -73,8 +72,7 @@ async function fetchData() {
throw new Error('Invalid state');
}
const userKeys = await userdata.decryptUserKeysWithBrowser();
const payload : { setupCode: string } = await JWE.parseCompact(me.setupCode).decrypt(Recipient.ecdhEs('org.cryptomator.hub.userkey', userKeys.ecdhKeyPair.privateKey));
setupCode.value = payload.setupCode;
setupCode.value = await userdata.decryptSetupCode(userKeys);
} catch (error) {
console.error('Retrieving setup code failed.', error);
onFetchError.value = error instanceof Error ? error : new Error('Unknown Error');
Expand Down

0 comments on commit 847ecc4

Please sign in to comment.