Files
speckle-server/packages/frontend-2/pages/authn.vue
T
Iain Sproat 37a0fa4094 fix(frontend & frontend-2): x-frame-options header for /authn routes should be DENY (#1719)
* fix(frontend-2): routes to /authn should set x-frame-options header to deny
* fix(frontend1): do not render authn route if in an iframe
* fix(nginx): should log in json format
2023-07-24 15:17:16 +01:00

30 lines
579 B
Vue

<template>
<NuxtPage />
</template>
<script setup lang="ts">
import { loginRoute } from '~~/lib/common/helpers/route'
/**
* Marking all auth/* pages as guest only & ensuring `/auth` can't be accessed as a page
* on its own
*/
definePageMeta({
layout: 'login-or-register',
middleware: [
'guest',
() => {
const { ssrContext } = useNuxtApp()
if (ssrContext) {
ssrContext.event.node.res.setHeader('x-frame-options', 'deny')
}
},
(to) => {
if (to.path === '/authn') {
return loginRoute
}
}
]
})
</script>