From 929e1e8ae347a68346549f53c98693385864d783 Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Mon, 17 Jul 2023 10:36:30 +0200 Subject: [PATCH] fix: after registration verify address --- persistence/sql/persister_registration.go | 1 + selfservice/hook/code_address_verifier.go | 1 + 2 files changed, 2 insertions(+) diff --git a/persistence/sql/persister_registration.go b/persistence/sql/persister_registration.go index 94aaabbdfbd8..fc83cba1a0be 100644 --- a/persistence/sql/persister_registration.go +++ b/persistence/sql/persister_registration.go @@ -77,6 +77,7 @@ func (p *Persister) CreateRegistrationCode(ctx context.Context, codeParams *code now := time.Now() registrationCode := &code.RegistrationCode{ + Address: codeParams.Address, CodeHMAC: p.hmacValue(ctx, codeParams.RawCode), IssuedAt: now, ExpiresAt: now.UTC().Add(p.r.Config().SelfServiceCodeMethodLifespan(ctx)), diff --git a/selfservice/hook/code_address_verifier.go b/selfservice/hook/code_address_verifier.go index ea377d8f389f..e9f15eaf3d73 100644 --- a/selfservice/hook/code_address_verifier.go +++ b/selfservice/hook/code_address_verifier.go @@ -49,6 +49,7 @@ func (cv *CodeAddressVerifier) ExecutePostRegistrationPostPersistHook(w http.Res va := s.Identity.VerifiableAddresses[idx] if !va.Verified && recoveryCode.Address == va.Value { va.Verified = true + va.Status = identity.VerifiableAddressStatusCompleted if err := cv.r.PrivilegedIdentityPool().UpdateVerifiableAddress(r.Context(), &va); err != nil { return errors.WithStack(err) }