- added working typescript support to vue

- added bouncer support
- added UserPolicies
- added first user index call
This commit is contained in:
Sockenklaus
2023-07-08 08:16:08 +02:00
parent 6d28aaecb7
commit 864da02de5
23 changed files with 619 additions and 582 deletions

View File

@@ -46,11 +46,12 @@
</n-form>
</template>
<script setup>
import { ref, reactive, watch } from 'vue'
<script setup lang="ts">
import { ref } from 'vue'
import { router } from '@inertiajs/vue3'
import type { FormInst } from 'naive-ui'
import LoginLayout from '@/layouts/LoginLayout.vue'
import FlashMessages from '@/components/FlashMessages'
import FlashMessages from '@/components/FlashMessages.vue'
defineOptions({ layout: LoginLayout })
const props = defineProps(['flashMessages'])
@@ -60,7 +61,7 @@
password: '',
})
const formRef = ref(null)
const formRef = ref<FormInst | null>(null)
const rules = ref({
username: {
@@ -75,15 +76,6 @@
}
})
function translateLoginError(errorMsg) {
switch(errorMsg.split(":")[0]) {
case 'E_INVALID_AUTH_PASSWORD':
return "Falsches Passwort eingegeben."
case 'E_INVALID_AUTH_UID':
return "Benutzername nicht gefunden"
}
}
function onClickLogin(){
formRef.value?.validate((errors) => {
if(!errors) router.post('login', form.value)