2022-05-28 16:16:36 +02:00
|
|
|
<template>
|
|
|
|
<div id="oauth2-apps">
|
|
|
|
<router-view :authUser="user"></router-view>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-05-28 17:14:52 +02:00
|
|
|
import { onUnmounted, toRefs } from 'vue'
|
2022-05-28 16:16:36 +02:00
|
|
|
|
2022-05-28 17:14:52 +02:00
|
|
|
import { OAUTH2_STORE, ROOT_STORE } from '@/store/constants'
|
2022-05-28 16:16:36 +02:00
|
|
|
import { IAuthUserProfile } from '@/types/user'
|
2022-05-28 17:14:52 +02:00
|
|
|
import { useStore } from '@/use/useStore'
|
2022-05-28 16:16:36 +02:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
user: IAuthUserProfile
|
|
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
|
2022-05-28 17:14:52 +02:00
|
|
|
const store = useStore()
|
|
|
|
|
2022-05-28 16:16:36 +02:00
|
|
|
const { user } = toRefs(props)
|
2022-05-28 17:14:52 +02:00
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)
|
|
|
|
store.commit(OAUTH2_STORE.MUTATIONS.SET_CLIENTS, [])
|
|
|
|
})
|
2022-05-28 16:16:36 +02:00
|
|
|
</script>
|