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 }