refactor(pages): move auth pages to auth subdirectory
				
					
				
			i.e., /login, /register, /logout
This commit is contained in:
		
							parent
							
								
									3415f41044
								
							
						
					
					
						commit
						1c69ad6c2c
					
				| @ -16,7 +16,7 @@ | ||||
| 		messages: "/messages", | ||||
| 		profile: `/user/${data?.value?.user?._id || 0}`, | ||||
| 		admin: "/admin", | ||||
| 		logout: "/logout", | ||||
| 		logout: "/auth/logout", | ||||
| 	}); | ||||
| 	let cur = ref<string>( | ||||
| 		Object.keys(itemMap.value).find( | ||||
| @ -80,13 +80,13 @@ | ||||
| 			</a-button> | ||||
| 		</div> | ||||
| 		<div class="acbut" v-if="!data"> | ||||
| 			<a-button size="large" @click="() => navigateTo('/login')"> | ||||
| 			<a-button size="large" @click="() => navigateTo('/auth/login')"> | ||||
| 				Login | ||||
| 			</a-button> | ||||
| 			<a-button | ||||
| 				size="large" | ||||
| 				type="primary" | ||||
| 				@click="() => navigateTo('/register')" | ||||
| 				@click="() => navigateTo('/auth/register')" | ||||
| 			> | ||||
| 				Register | ||||
| 			</a-button> | ||||
|  | ||||
| @ -52,7 +52,7 @@ export default defineNuxtConfig({ | ||||
| 		provider: { | ||||
| 			type: "local", | ||||
| 			pages: { | ||||
| 				login: "/login", | ||||
| 				login: "/auth/login", | ||||
| 			}, | ||||
| 			token: { | ||||
| 				signInResponseTokenPointer: "/token", | ||||
| @ -156,4 +156,9 @@ export default defineNuxtConfig({ | ||||
| 	// components: {
 | ||||
| 	// 	transform: (str) =>
 | ||||
| 	// },
 | ||||
| 	typescript: { | ||||
| 		tsConfig: { | ||||
| 			exclude: ["./.nuxt/types/auth.d.ts"], | ||||
| 		}, | ||||
| 	}, | ||||
| }); | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| <script lang="ts" setup> | ||||
| 	import { ref, reactive } from "vue"; | ||||
| 	import useApiFetch from "../composables/useApiFetch"; | ||||
| 	import useApiFetch from "../../composables/useApiFetch"; | ||||
| 	import { notification } from "ant-design-vue"; | ||||
| 	interface FormState { | ||||
| 		username: string; | ||||
| @ -80,7 +80,7 @@ | ||||
| 		}, | ||||
| 	}); | ||||
| 	onVerify((resp) => { | ||||
| 		// log.debug("onverify called", resp); | ||||
| 		console.debug("onverify called", resp); | ||||
| 		srv(resp); | ||||
| 	}); | ||||
| 	const onFinish = handleSubmit(async (values: any, actions: any) => { | ||||
| @ -123,7 +123,7 @@ notification[ "error" ]({ | ||||
| 			<a-form-item | ||||
| 				label="Username" | ||||
| 				:name="field.name" | ||||
| 				:validate-status="!!errorMessage ? 'error' : undefined" | ||||
| 				:validate-status="!!errorMessage ? 'error' : ''" | ||||
| 				:help="errorMessage" | ||||
| 			> | ||||
| 				<a-input v-bind="field" v-model:value="field.value" /> | ||||
| @ -133,7 +133,7 @@ notification[ "error" ]({ | ||||
| 			<a-form-item | ||||
| 				label="Email address" | ||||
| 				:name="field.name" | ||||
| 				:validate-status="!!errorMessage ? 'error' : undefined" | ||||
| 				:validate-status="!!errorMessage ? 'error' : ''" | ||||
| 				:help="errorMessage" | ||||
| 			> | ||||
| 				<a-input v-bind="field" v-model:value="field.value" /> | ||||
| @ -143,7 +143,7 @@ notification[ "error" ]({ | ||||
| 			<a-form-item | ||||
| 				label="Password" | ||||
| 				:name="field.name" | ||||
| 				:validate-status="!!errorMessage ? 'error' : undefined" | ||||
| 				:validate-status="!!errorMessage ? 'error' : ''" | ||||
| 				:help="errorMessage" | ||||
| 			> | ||||
| 				<a-input-password v-bind="field" v-model:value="field.value" /> | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user