From 57f63dd0862fc37d3a7aab4d433a80f69da6ed7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Fri, 9 Aug 2024 07:31:54 +0000 Subject: [PATCH] fix: where create email address --- adapters/gorm/gorm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/gorm/gorm.go b/adapters/gorm/gorm.go index 091560a..2dcfd62 100644 --- a/adapters/gorm/gorm.go +++ b/adapters/gorm/gorm.go @@ -39,7 +39,7 @@ func New(db *gorm.DB) *gormAdapter { // CreateUser is a helper function to create a new user. func (a *gormAdapter) CreateUser(ctx context.Context, user adapters.GothUser) (adapters.GothUser, error) { - err := a.db.WithContext(ctx).FirstOrCreate(&user).Error + err := a.db.WithContext(ctx).Where(adapters.GothUser{Email: user.Email}).FirstOrCreate(&user).Error if err != nil { return adapters.GothUser{}, goth.ErrMissingUser }