mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 02:58:11 +00:00
fix(oidc): prompts slice conversion function returns slice which contains unexpected empty strings (#8997)
# Which Problems Are Solved Slice initialized with a fixed length instead of capacity, this leads to unexpected results when calling the append function. # How the Problems Are Solved fixed slice initialization, slice is initialized with zero length and with capacity of function's argument # Additional Changes test case added # Additional Context none Co-authored-by: Kolokhanin Roman <zuzmic@gmail.com> Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
This commit is contained in:
@@ -158,7 +158,7 @@ func IpFromContext(ctx context.Context) net.IP {
|
||||
}
|
||||
|
||||
func PromptToBusiness(oidcPrompt []string) []domain.Prompt {
|
||||
prompts := make([]domain.Prompt, len(oidcPrompt))
|
||||
prompts := make([]domain.Prompt, 0, len(oidcPrompt))
|
||||
for _, oidcPrompt := range oidcPrompt {
|
||||
switch oidcPrompt {
|
||||
case oidc.PromptNone:
|
||||
|
Reference in New Issue
Block a user