Skip to content

Commit

Permalink
Remove subquery to fix uniqely reference users table
Browse files Browse the repository at this point in the history
Signed-off-by: Shiv Verma <[email protected]>
  • Loading branch information
pratap0007 committed Nov 15, 2023
1 parent 8b746af commit e2b55ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/pkg/auth/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (r *request) insertData(gitUser goth.User, code, provider string) error {
}
} else { // when the email of user already exists
// Update the users table with the auth code
if err := userQuery.Update("code", code).Error; err != nil {
if err := r.db.Model(&model.User{}).Where("email = ?", gitUser.Email).Update("code", code).Error; err != nil {
r.log.Error(err)
return err
}
Expand Down

0 comments on commit e2b55ac

Please sign in to comment.