Skip to content

Commit

Permalink
auth -google api fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushikeshnimkar committed Aug 6, 2024
1 parent d5716d9 commit 5d27386
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions api/v1/account/auth-google.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func authGoogle(c *gin.Context) {
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
if userId != "" {
err = db.Model(&models.User{}).Where("user_id = ?", userId).Update("email_id", email).Error
err = db.Model(&models.User{}).Where("user_id = ?", userId).Updates(models.User{EmailId: &email}).Error
if err != nil {
logwrapper.Errorf("failed to update user email: %s", err)
httpo.NewErrorResponse(http.StatusInternalServerError, "internal server error").SendD(c)
Expand All @@ -64,7 +64,6 @@ func authGoogle(c *gin.Context) {
httpo.NewSuccessResponse(200, "email linked successfully").SendD(c)
return
}

// User does not exist, so create a new user
user = models.User{
EmailId: &email,
Expand Down

0 comments on commit 5d27386

Please sign in to comment.