From 74841dfb1cc687cfc4c7466f7bf3f6c19bf51a4a Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Mon, 21 Aug 2023 14:21:45 +0200 Subject: [PATCH] fix: setMetadata in saml and pre access token triggers (#6398) (cherry picked from commit 84faf98bc28fce5e44c0e076d5fcea09aa64b9d3) --- internal/api/oidc/client.go | 3 ++- internal/api/saml/storage.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/api/oidc/client.go b/internal/api/oidc/client.go index 8ce41d747..6a8dc6be6 100644 --- a/internal/api/oidc/client.go +++ b/internal/api/oidc/client.go @@ -712,7 +712,7 @@ func (o *OPStorage) privateClaimsFlows(ctx context.Context, userID string, userG }), ), actions.SetFields("user", - actions.SetFields("setMetadata", func(call goja.FunctionCall) { + actions.SetFields("setMetadata", func(call goja.FunctionCall) goja.Value { if len(call.Arguments) != 2 { panic("exactly 2 (key, value) arguments expected") } @@ -733,6 +733,7 @@ func (o *OPStorage) privateClaimsFlows(ctx context.Context, userID string, userG logging.WithError(err).Info("unable to set md in action") panic(err) } + return nil }), ), ), diff --git a/internal/api/saml/storage.go b/internal/api/saml/storage.go index 7a0d10f56..c5d348ccb 100644 --- a/internal/api/saml/storage.go +++ b/internal/api/saml/storage.go @@ -266,7 +266,7 @@ func (p *Storage) getCustomAttributes(ctx context.Context, user *query.User, use }), ), actions.SetFields("user", - actions.SetFields("setMetadata", func(call goja.FunctionCall) { + actions.SetFields("setMetadata", func(call goja.FunctionCall) goja.Value { if len(call.Arguments) != 2 { panic("exactly 2 (key, value) arguments expected") } @@ -287,6 +287,7 @@ func (p *Storage) getCustomAttributes(ctx context.Context, user *query.User, use logging.WithError(err).Info("unable to set md in action") panic(err) } + return nil }), ), ),