Implement authentication phase with Cidaas OAuth2 integration
- Add authentication middleware to protect routes - Create API endpoints for login, logout, registration, and user info - Develop UI components for login and registration forms - Integrate VeeValidate for form validation - Update environment configuration for Cidaas settings - Add i18n support for English and German languages - Enhance Tailwind CSS for improved styling of auth components - Document authentication flow and testing procedures
This commit is contained in:
36
app/components/ui/form/FormControl.vue
Normal file
36
app/components/ui/form/FormControl.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<script setup lang="ts">
|
||||
import type { PrimitiveProps } from 'reka-ui'
|
||||
import { inject } from 'vue'
|
||||
import { Primitive } from 'reka-ui'
|
||||
import { useFieldError } from 'vee-validate'
|
||||
import type { FormItemContext } from '.'
|
||||
import { FORM_ITEM_INJECT_KEY } from '.'
|
||||
|
||||
/**
|
||||
* FormControl component - Wrapper for form input elements
|
||||
* Provides accessibility attributes and connects to form validation
|
||||
*/
|
||||
|
||||
interface Props extends PrimitiveProps {}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
as: 'div',
|
||||
})
|
||||
|
||||
// Get the form item context for ID
|
||||
const formItemContext = inject<FormItemContext>(FORM_ITEM_INJECT_KEY)
|
||||
|
||||
// Get field validation state from the nearest parent field
|
||||
const error = useFieldError()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Primitive
|
||||
:id="formItemContext?.id"
|
||||
v-bind="props"
|
||||
:aria-describedby="error ? `${formItemContext?.id}-message` : undefined"
|
||||
:aria-invalid="!!error"
|
||||
>
|
||||
<slot />
|
||||
</Primitive>
|
||||
</template>
|
||||
Reference in New Issue
Block a user