Major refactor of frontend source tree such that paths better match where they are served.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<RestrictedAuth
|
||||
:mode="authMode"
|
||||
@authenticated="handleAuthenticated"
|
||||
@logout="handleLogout"
|
||||
@back="goBack"
|
||||
@home="returnHome"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted } from 'vue'
|
||||
import RestrictedAuth from '@/components/RestrictedAuth.vue'
|
||||
import { uiBasePath } from '@/utils/settings'
|
||||
import { goBack } from '@/utils/helpers'
|
||||
|
||||
const basePath = computed(() => uiBasePath())
|
||||
|
||||
// Detect mode from URL parameters
|
||||
const authMode = computed(() => {
|
||||
const params = new URLSearchParams(window.location.search)
|
||||
return params.get('mode') === 'reauth' ? 'reauth' : 'login'
|
||||
})
|
||||
|
||||
function handleAuthenticated() {
|
||||
location.reload()
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
function returnHome() {
|
||||
const target = basePath.value || '/auth/'
|
||||
if (window.location.pathname !== target) history.replaceState(null, '', target)
|
||||
window.location.href = target
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// Handle Escape key to trigger back navigation
|
||||
window.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Escape') goBack()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Access Restricted</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/int/forward/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './RestrictedForward.vue'
|
||||
import '@/assets/style.css'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
Reference in New Issue
Block a user