Skip to content

Commit

Permalink
Remove e-mail logging (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
memeToasty authored Mar 6, 2024
1 parent e82998d commit ef120dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*secret.yaml
private_key.yaml
.DS_STORE
*.pem
7 changes: 4 additions & 3 deletions backend/services/user/handler/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func New(s store.UserStore, cS pbCollaboration.CollaborationService) *User {
}

func (e *User) Register(ctx context.Context, req *pbCommon.User, rsp *pbCommon.Success) error {
logger.Infof("Received User.Register request: email: %v", req.UserEmail)
logger.Infof("Received User.Register request")
if _, err := e.store.FindUserByEmail(ctx, req.UserEmail); err == nil {
return helper.NewMicroUserAlreadyExistsErr(helper.UserServiceID)
} else if !errors.Is(err, helper.ErrStoreNoExistingUserWithEmail) {
Expand Down Expand Up @@ -73,6 +73,7 @@ func (e *User) Register(ctx context.Context, req *pbCommon.User, rsp *pbCommon.S
}

func (e *User) VerifyUserExists(ctx context.Context, req *pbCommon.User, rsp *pbCommon.Success) error {
logger.Infof("Received User.VerifyUserExists request")
user, err := e.store.FindUserByEmail(ctx, req.UserEmail)
if err != nil {
return err
Expand Down Expand Up @@ -117,7 +118,7 @@ func (e *User) DeleteUser(ctx context.Context, req *pbCommon.User, rsp *pbCommon
}

func (e *User) Login(ctx context.Context, req *pbCommon.User, rsp *pbCommon.User) error {
logger.Infof("Received User.Login request: email: %v", req.UserEmail)
logger.Infof("Received User.Login request")
user, err := e.store.FindUserByEmail(ctx, req.UserEmail)
if err != nil {
if errors.Is(err, helper.ErrStoreNoExistingUserWithEmail) {
Expand All @@ -136,7 +137,7 @@ func (e *User) Login(ctx context.Context, req *pbCommon.User, rsp *pbCommon.User
}

func (e *User) GetUserIDFromEmail(ctx context.Context, req *pbCommon.User, rsp *pbCommon.User) error {
logger.Infof("Received User.GetUserIDFromEmail request: %v", req)
logger.Infof("Received User.GetUserIDFromEmail request")
user, err := e.store.FindUserByEmail(ctx, req.UserEmail)
if err != nil {
if errors.Is(err, helper.ErrStoreNoExistingUserWithEmail) {
Expand Down
7 changes: 3 additions & 4 deletions backend/store/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"os"
"strings"
"time"

"github.com/kioku-project/kioku/pkg/helper"
"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -45,9 +44,9 @@ func NewPostgresStore(ctx context.Context) (*gorm.DB, error) {
logger := logger.New(
logrus.NewWriter(),
logger.Config{
SlowThreshold: time.Millisecond,
LogLevel: logger.Warn,
Colorful: false,
LogLevel: logger.Silent,
Colorful: false,
IgnoreRecordNotFoundError: true,
},
)

Expand Down

0 comments on commit ef120dd

Please sign in to comment.