From 3a372fdea284df1ffc1006df8b307c856b55f707 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:57:55 +0200 Subject: [PATCH] chore: synchronize workspaces --- consent/helper_test.go | 2 +- flow/flow.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/consent/helper_test.go b/consent/helper_test.go index 32637554088..1acd69d3496 100644 --- a/consent/helper_test.go +++ b/consent/helper_test.go @@ -266,7 +266,7 @@ func TestValidateCsrfSession(t *testing.T) { assert.NoError(t, err, "failed to save cookie %s", c.name) } - err := ValidateCsrfSession(r, config, store, name, tc.csrfValue) + err := ValidateCsrfSession(r, config, store, name, tc.csrfValue, nil) if tc.expectError { assert.Error(t, err) } else { diff --git a/flow/flow.go b/flow/flow.go index 999a06ca1cd..4f8522bfa1d 100644 --- a/flow/flow.go +++ b/flow/flow.go @@ -295,9 +295,11 @@ func (f *Flow) HandleLoginRequest(h *consent.HandledLoginRequest) error { f.LoginExtendSessionLifespan = h.ExtendSessionLifespan f.ACR = h.ACR f.AMR = h.AMR - if h.Context == nil { + + if len(h.Context) > 0 { f.Context = h.Context } + f.LoginWasUsed = h.WasHandled f.LoginAuthenticatedAt = h.AuthenticatedAt return nil @@ -390,7 +392,7 @@ func (f *Flow) HandleConsentRequest(r *consent.AcceptOAuth2ConsentRequest) error f.ConsentWasHandled = r.WasHandled f.ConsentError = r.Error - if r.Context != nil { + if len(r.Context) > 0 { f.Context = r.Context }