Skip to content

Commit

Permalink
fix: Fixes auth
Browse files Browse the repository at this point in the history
  • Loading branch information
salehkhazaei committed Aug 1, 2024
1 parent edd44e1 commit 9e91094
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions pkg/auth/auth0/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,23 @@ func (a *Service) GetOrCreateUser(userID, email string) (*User, error) {
}

if user == nil || user.UserId == "" {
appMetadataJsonb := pgtype.JSONB{}
err = appMetadataJsonb.Set([]byte(""))
if err != nil {
return nil, err
}

userMetadataJsonb := pgtype.JSONB{}
err = userMetadataJsonb.Set([]byte(""))
if err != nil {
return nil, err
}

user = &db.User{
Email: email,
UserId: userID,
Email: email,
UserId: userID,
AppMetadata: appMetadataJsonb,
UserMetadata: userMetadataJsonb,
}
err = a.database.CreateUser(user)
if err != nil {
Expand Down

0 comments on commit 9e91094

Please sign in to comment.