Skip to content

Commit

Permalink
fix: after registration verify address
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko committed Jul 17, 2023
1 parent c2a15e3 commit 929e1e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions persistence/sql/persister_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
1 change: 1 addition & 0 deletions selfservice/hook/code_address_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 929e1e8

Please sign in to comment.