From 0d2c4502a7c768ff7fd99a51a1c569689b956d58 Mon Sep 17 00:00:00 2001 From: pratap0007 Date: Wed, 8 Nov 2023 13:25:51 +0530 Subject: [PATCH] Remove subquery to fix uniqely reference users table Signed-off-by: Shiv Verma --- api/pkg/auth/service/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pkg/auth/service/service.go b/api/pkg/auth/service/service.go index 955b101c7b..22863c3a9b 100644 --- a/api/pkg/auth/service/service.go +++ b/api/pkg/auth/service/service.go @@ -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 }