- added working typescript support to vue
- added bouncer support - added UserPolicies - added first user index call
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user