feat: basic login page

This commit is contained in:
Anthony Fu 2022-11-21 18:27:28 +08:00
parent 89845517e3
commit af2c6d622b
3 changed files with 28 additions and 20 deletions

3
layouts/none.vue Normal file
View file

@ -0,0 +1,3 @@
<template>
<slot />
</template>

View file

@ -1,4 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
definePageMeta({
layout: 'none',
})
const { query } = useRoute() const { query } = useRoute()
onMounted(async () => { onMounted(async () => {
@ -11,7 +15,9 @@ onMounted(async () => {
</script> </script>
<template> <template>
<div> <div h-full flex>
Login... <div ma>
Login...
</div>
</div> </div>
</template> </template>

View file

@ -1,5 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
const { server, token } = useAppCookies() definePageMeta({
layout: 'none',
})
const server = ref(useAppCookies().server.value)
async function oauth() { async function oauth() {
const a = document.createElement('a') const a = document.createElement('a')
@ -10,23 +14,18 @@ async function oauth() {
</script> </script>
<template> <template>
<div p4> <div h-full text-center justify-center flex="~ col items-center gap2">
<button @click="oauth()"> <div text-4xl mb-10>
OAuth Nuxtodon
</div>
<div>Mastodon Server</div>
<div bg-gray:10 px2 py1 rounded border="~ border" w-50 mxa flex>
<span op25 mr1>https://</span>
<input v-model="server" outline-none bg-transparent>
</div>
<button bg-teal6 px2 py1 rounded w-20 mxa mt-5 @click="oauth()">
Login
</button> </button>
<input
v-model="server"
placeholder="Server URL"
bg-transparent text-current
border="~ border" p="x2 y1" w-full
outline-none
>
<input
v-model="token"
placeholder="Token"
bg-transparent text-current
border="~ border" p="x2 y1" w-full
outline-none
>
</div> </div>
</template> </template>