A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
fix(code-smells): security hotspot using math.random
aminnausin2b034350380e
diff --git a/resources/js/components/cedar-ui/input/LabelledTextInput.vue b/resources/js/components/cedar-ui/input/LabelledTextInput.vueindex cce51c70..e0834205 100644--- a/resources/js/components/cedar-ui/input/LabelledTextInput.vue+++ b/resources/js/components/cedar-ui/input/LabelledTextInput.vue@@ -1,12 +1,14 @@<script setup lang="ts">import type { LabelledTextInputProps } from '@aminnausin/cedar-ui';+import { computed, useId } from 'vue';import { FormLabel } from '../form';import { TextInput } from '.';-withDefaults(defineProps<LabelledTextInputProps>(), {- id: 'text-input-labelled-' + Math.floor(Math.random() * 10000),-});+const props = defineProps<LabelledTextInputProps>();++const autoId = useId();+const id = computed(() => props.id ?? `text-input-labelled-${autoId}`);const model = defineModel();</script>