From ceff2da2a0ab2308cc8127b7e22db23458e91a83 Mon Sep 17 00:00:00 2001 From: Arne Luenser Date: Tue, 27 Aug 2024 12:06:10 +0200 Subject: [PATCH] fix: store provider --- .../TestStrategy-method=TestPopulateSignUpMethod.json | 6 +++--- selfservice/strategy/oidc/strategy_login.go | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/selfservice/strategy/oidc/.snapshots/TestStrategy-method=TestPopulateSignUpMethod.json b/selfservice/strategy/oidc/.snapshots/TestStrategy-method=TestPopulateSignUpMethod.json index 615bdb82820f..cb95fd5e6c8f 100644 --- a/selfservice/strategy/oidc/.snapshots/TestStrategy-method=TestPopulateSignUpMethod.json +++ b/selfservice/strategy/oidc/.snapshots/TestStrategy-method=TestPopulateSignUpMethod.json @@ -130,7 +130,7 @@ "attributes": { "name": "provider", "type": "submit", - "value": "neverPKCE", + "value": "forcePKCE", "disabled": false, "node_type": "input" }, @@ -138,10 +138,10 @@ "meta": { "label": { "id": 1040002, - "text": "Sign up with neverPKCE", + "text": "Sign up with forcePKCE", "type": "info", "context": { - "provider": "neverPKCE" + "provider": "forcePKCE" } } } diff --git a/selfservice/strategy/oidc/strategy_login.go b/selfservice/strategy/oidc/strategy_login.go index 307135a6d2a2..267e92b5dd2d 100644 --- a/selfservice/strategy/oidc/strategy_login.go +++ b/selfservice/strategy/oidc/strategy_login.go @@ -279,6 +279,10 @@ func (s *Strategy) Login(w http.ResponseWriter, r *http.Request, f *login.Flow, span.SetAttributes(attribute.Bool("pkce", ok)) } + if err := storeProvider(f, pid); err != nil { + return nil, s.handleError(w, r, f, pid, nil, errors.WithStack(herodot.ErrInternalServerError.WithReason("Could not update flow context").WithDebug(err.Error()))) + } + f.Active = s.ID() if err = s.d.LoginFlowPersister().UpdateLoginFlow(ctx, f); err != nil { return nil, s.handleError(w, r, f, pid, nil, errors.WithStack(herodot.ErrInternalServerError.WithReason("Could not update flow").WithDebug(err.Error())))