elk/components/user/UserSignIn.vue

31 lines
835 B
Vue
Raw Normal View History

2022-11-23 04:06:56 +01:00
<script setup lang="ts">
import { DEFAULT_SERVER } from '~/constants'
2022-11-23 10:06:32 +01:00
let server = $ref<string>('')
2022-11-23 04:06:56 +01:00
async function oauth() {
2022-11-23 10:06:32 +01:00
location.href = `/api/${server || DEFAULT_SERVER}/login`
}
async function handleInput() {
if (server.startsWith('https://'))
server = server.replace('https://', '')
2022-11-23 04:06:56 +01:00
}
</script>
2022-11-23 03:53:22 +01:00
<template>
2022-11-23 04:06:56 +01:00
<div h-full text-center justify-center flex="~ col items-center gap2">
2022-11-23 04:48:01 +01:00
<div text-3xl mb2>
Sign in
2022-11-23 03:53:22 +01:00
</div>
2022-11-23 04:48:01 +01:00
<div>Mastodon Server Name</div>
2022-11-23 04:06:56 +01:00
<div flex bg-gray:10 px2 py1 mxa rounded border="~ border" w-80 text-xl items-center>
<span op35 mr1 text-sm>https://</span>
2022-11-23 10:06:32 +01:00
<input v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput">
2022-11-23 04:06:56 +01:00
</div>
2022-11-23 04:48:01 +01:00
<button btn-solid mxa mt2 @click="oauth()">
2022-11-23 03:53:22 +01:00
Sign in
2022-11-23 04:06:56 +01:00
</button>
2022-11-23 03:53:22 +01:00
</div>
</template>