From 32840d390992db0e449362ead296edf9fcbea186 Mon Sep 17 00:00:00 2001 From: Jens L Date: Mon, 20 Mar 2023 18:15:36 +0100 Subject: [PATCH] web/admin: fix error adding users to groups (#5016) * web/admin: fix error adding users to groups and vice versa Signed-off-by: Jens Langhammer * remove seed Signed-off-by: Jens Langhammer --------- Signed-off-by: Jens Langhammer --- go.mod | 2 +- internal/common/global.go | 2 -- web/src/elements/chips/ChipGroup.ts | 5 ++++- web/src/elements/forms/Form.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index f99ebdfb5..e219a50a5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module goauthentik.io -go 1.18 +go 1.20 require ( github.com/Netflix/go-env v0.0.0-20210215222557-e437a7e7f9fb diff --git a/internal/common/global.go b/internal/common/global.go index 4e6aaa5d9..2ee3e1f58 100644 --- a/internal/common/global.go +++ b/internal/common/global.go @@ -1,7 +1,6 @@ package common import ( - "math/rand" "os" "os/signal" "syscall" @@ -11,7 +10,6 @@ import ( ) func Init() chan os.Signal { - rand.Seed(time.Now().UnixNano()) interrupt := make(chan os.Signal, 1) signal.Notify(interrupt, os.Interrupt) signal.Notify(interrupt, syscall.SIGINT) diff --git a/web/src/elements/chips/ChipGroup.ts b/web/src/elements/chips/ChipGroup.ts index 71ea481d4..24d8c3876 100644 --- a/web/src/elements/chips/ChipGroup.ts +++ b/web/src/elements/chips/ChipGroup.ts @@ -2,7 +2,7 @@ import { AKElement } from "@goauthentik/elements/Base"; import { Chip } from "@goauthentik/elements/chips/Chip"; import { CSSResult, TemplateResult, css, html } from "lit"; -import { customElement } from "lit/decorators.js"; +import { customElement, property } from "lit/decorators.js"; import PFButton from "@patternfly/patternfly/components/Button/button.css"; import PFChip from "@patternfly/patternfly/components/Chip/chip.css"; @@ -28,6 +28,9 @@ export class ChipGroup extends AKElement { ]; } + @property() + name?: string; + set value(v: (string | number | undefined)[]) { return; } diff --git a/web/src/elements/forms/Form.ts b/web/src/elements/forms/Form.ts index 89f47c691..dcee4c38b 100644 --- a/web/src/elements/forms/Form.ts +++ b/web/src/elements/forms/Form.ts @@ -201,7 +201,7 @@ export class Form extends AKElement { json: { [key: string]: unknown }, ): void { let parent = json; - if (!element.name.includes(".")) { + if (!element.name?.includes(".")) { parent[element.name] = value; return; }