mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 00:02:19 +00:00
fix: replace crypto.randomUUID with generateRandomString for HTTP compatibility (#5849)
Replace crypto.randomUUID() with generateRandomString() in triggers.svelte.ts to fix schedule trigger creation on HTTP connections. The crypto.randomUUID() API requires a secure context (HTTPS), which breaks functionality for users connecting to Windmill over HTTP in internal networks. Fixes #5847 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: rubenfiszel <rubenfiszel@users.noreply.github.com>
This commit is contained in:
@@ -20,7 +20,7 @@ import type { Writable } from 'svelte/store'
|
||||
import type { TriggerType } from './utils'
|
||||
import type { UserExt } from '$lib/stores'
|
||||
import type { ScheduleTrigger } from '../triggers'
|
||||
import { canWrite, formatCron } from '$lib/utils'
|
||||
import { canWrite, formatCron, generateRandomString } from '$lib/utils'
|
||||
|
||||
export class Triggers {
|
||||
#triggers = $state<Trigger[]>([])
|
||||
@@ -94,7 +94,7 @@ export class Triggers {
|
||||
const primaryScheduleExists = this.#triggers.some((t) => t.type === 'schedule' && t.isPrimary)
|
||||
|
||||
// Create the new draft trigger
|
||||
const draftId = crypto.randomUUID()
|
||||
const draftId = generateRandomString()
|
||||
const isPrimary = type === 'schedule' && !primaryScheduleExists
|
||||
const newTrigger = {
|
||||
id: draftId,
|
||||
|
||||
Reference in New Issue
Block a user