Added gateway view for unauthenticated access to secure resources.
This commit is contained in:
		
							parent
							
								
									035d2cde85
								
							
						
					
					
						commit
						321bad46a7
					
				| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					<script setup lang="ts">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <h3>Login</h3>
 | 
				
			||||||
 | 
					    <button>Submit!</button>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					<script setup lang="ts">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <div>
 | 
				
			||||||
 | 
					    <h3>Register</h3>
 | 
				
			||||||
 | 
					    <button>Register now!!!</button>
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,31 @@
 | 
				
			||||||
import {createRouter, createWebHistory} from 'vue-router'
 | 
					import {createRouter, createWebHistory} from 'vue-router'
 | 
				
			||||||
import MainView from "@/views/MainView.vue";
 | 
					import MainView from "@/views/MainView.vue";
 | 
				
			||||||
 | 
					import GatewayView from "@/views/GatewayView.vue";
 | 
				
			||||||
 | 
					import LoginForm from "@/components/gateway/LoginForm.vue";
 | 
				
			||||||
 | 
					import RegisterForm from "@/components/gateway/RegisterForm.vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const router = createRouter({
 | 
					const router = createRouter({
 | 
				
			||||||
  history: createWebHistory(import.meta.env.BASE_URL),
 | 
					  history: createWebHistory(import.meta.env.BASE_URL),
 | 
				
			||||||
  routes: [
 | 
					  routes: [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      path: '/',
 | 
					      path: "/",
 | 
				
			||||||
      name: 'home',
 | 
					      name: "home",
 | 
				
			||||||
      component: MainView
 | 
					      component: MainView
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      path: "/gateway",
 | 
				
			||||||
 | 
					      name: "gateway",
 | 
				
			||||||
 | 
					      component: GatewayView,
 | 
				
			||||||
 | 
					      children: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          path: "login",
 | 
				
			||||||
 | 
					          component: LoginForm
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          path: "register",
 | 
				
			||||||
 | 
					          component: RegisterForm
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  ]
 | 
					  ]
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					<!--
 | 
				
			||||||
 | 
					This is a view shown to unauthenticated users before they login or register
 | 
				
			||||||
 | 
					to the node. Attempting to access a non-public piece of content or other page
 | 
				
			||||||
 | 
					will redirect to the gateway before the user is allowed to view/edit it.
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<script setup lang="ts">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <main>
 | 
				
			||||||
 | 
					    <h1>Gateway View</h1>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <RouterView/>
 | 
				
			||||||
 | 
					  </main>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
		Loading…
	
		Reference in New Issue