37a0fa4094
* 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
30 lines
579 B
Vue
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>
|