Skip to content

Commit

Permalink
fix: log errors inside VerifyPhoneCode (#470)
Browse files Browse the repository at this point in the history
* log errors inside VerifyPhoneCode
  • Loading branch information
mfrancisc authored Oct 1, 2024
1 parent bc6b76d commit 503d232
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/controller/signup.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ func (s *Signup) VerifyPhoneCodeHandler(ctx *gin.Context) {

err := s.app.VerificationService().VerifyPhoneCode(ctx, userID, username, code)
if err != nil {
log.Error(ctx, err, "error validating user verification phone code")
e := &crterrors.Error{}
switch {
case errors.As(err, &e):
Expand Down
2 changes: 2 additions & 0 deletions pkg/verification/service/verification_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ func (s *ServiceImpl) VerifyPhoneCode(ctx *gin.Context, userID, username, code s
doUpdate := func() error {
signup, err := s.Services().SignupService().GetUserSignupFromIdentifier(userID, username)
if err != nil {
log.Error(ctx, err, fmt.Sprintf("error getting signup from identifier. user_id: %s | username: %s", userID, username))
return err
}

Expand All @@ -342,6 +343,7 @@ func (s *ServiceImpl) VerifyPhoneCode(ctx *gin.Context, userID, username, code s

_, err = s.Services().SignupService().UpdateUserSignup(signup)
if err != nil {
log.Error(ctx, err, fmt.Sprintf("error updating usersignup: %s", signup.Name))
return err
}

Expand Down

0 comments on commit 503d232

Please sign in to comment.