This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anton Biriukov <anton.biriukov@avast.com> Signed-off-by: talwinder50 <talwinder.kaur@avast.com> Signed-off-by: Andrii Holovko <andriy.holovko@gmail.com> Signed-off-by: Filip Burlacu filip.burlacu@securekey.com Signed-off-by: Rolson Quadras <rolson.quadras@securekey.com>
- Loading branch information
1 parent
695c043
commit a4f84bd
Showing
21 changed files
with
512 additions
and
820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,53 @@ | ||
<!-- | ||
* Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<script setup> | ||
import { computed, inject, onMounted, ref } from 'vue'; | ||
import { useRoute } from 'vue-router'; | ||
import { useStore } from 'vuex'; | ||
import { CHAPIHandler } from '@/mixins'; | ||
import useBreakpoints from '@/plugins/breakpoints.js'; | ||
|
||
// Local Variables | ||
const disableCHAPI = ref(false); | ||
const loaded = ref(false); | ||
|
||
// Hooks | ||
const route = useRoute(); | ||
const store = useStore(); | ||
const breakpoints = useBreakpoints(); | ||
const polyfill = inject('polyfill'); | ||
const webCredentialHandler = inject('webCredentialHandler'); | ||
|
||
// Store Getters | ||
const currentUser = computed(() => store.getters['getCurrentUser']); | ||
const agentOpts = computed(() => store.getters['getAgentOpts']); | ||
|
||
// Store Actions | ||
const activateCHAPI = () => store.dispatch('activateCHAPI'); | ||
|
||
onMounted(async () => { | ||
// if intended target doesn't require CHAPI. | ||
disableCHAPI.value = route.params.disableCHAPI || false; | ||
try { | ||
if (!breakpoints.xs && !breakpoints.sm && !disableCHAPI.value) { | ||
const chapi = new CHAPIHandler( | ||
polyfill, | ||
webCredentialHandler, | ||
agentOpts.value.credentialMediatorURL | ||
); | ||
await chapi.install(currentUser.value.username); | ||
activateCHAPI(); | ||
} | ||
} catch (e) { | ||
console.log('Could not initialize Vue App:', e); | ||
} | ||
loaded.value = true; | ||
}); | ||
</script> | ||
<template> | ||
<router-view /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.