Initial
This commit is contained in:
69
spaces/pages/login.vue
Normal file
69
spaces/pages/login.vue
Normal file
@@ -0,0 +1,69 @@
|
||||
<script setup >
|
||||
|
||||
const { login } = useStrapiAuth()
|
||||
const router = useRouter()
|
||||
|
||||
const username = ref("flfeders")
|
||||
const password = ref("Open@all4me!")
|
||||
|
||||
|
||||
const onSubmit = async () => {
|
||||
try {
|
||||
await login({identifier: username.value, password: password.value})
|
||||
console.log("Successfully Logged In")
|
||||
router.push("/tasks")
|
||||
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
const user = useStrapiUser()
|
||||
console.log(user)
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div id="loginSite">
|
||||
<div id="loginForm">
|
||||
<UFormGroup
|
||||
label="Username:"
|
||||
>
|
||||
<UInput
|
||||
v-model="username"
|
||||
/>
|
||||
</UFormGroup>
|
||||
<UFormGroup
|
||||
label="Passwort:"
|
||||
>
|
||||
<UInput
|
||||
v-model="password"
|
||||
type="password"
|
||||
/>
|
||||
</UFormGroup>
|
||||
<UButton
|
||||
@click="onSubmit"
|
||||
class="mt-3"
|
||||
>
|
||||
Einloggen
|
||||
</UButton>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#loginSite {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
#loginForm {
|
||||
width: 30vw;
|
||||
height: 30vh;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user