forked from Mirrors/elk
feat: allow key enter for sign in (#142)
This commit is contained in:
parent
0f0acd4824
commit
39de2c36a6
1 changed files with 4 additions and 1 deletions
|
@ -4,6 +4,9 @@ import { DEFAULT_SERVER } from '~/constants'
|
|||
let server = $ref<string>('')
|
||||
|
||||
async function oauth() {
|
||||
if (!server)
|
||||
return
|
||||
|
||||
server = server.split('/')[0]
|
||||
location.href = `/api/${server || DEFAULT_SERVER}/login`
|
||||
}
|
||||
|
@ -22,7 +25,7 @@ async function handleInput() {
|
|||
<div>Mastodon Server Name</div>
|
||||
<div flex bg-gray:10 px2 py1 mxa rounded border="~ border" text-xl items-center>
|
||||
<span op35 mr1 text-sm>https://</span>
|
||||
<input v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput">
|
||||
<input v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput" @keyup.enter="oauth()">
|
||||
</div>
|
||||
<button btn-solid mt2 @click="oauth()">
|
||||
Sign in
|
||||
|
|
Loading…
Reference in a new issue