feat: implement logger
This commit is contained in:
@@ -8,10 +8,12 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.ma-al.com/goc_daniel/b2b/app/config"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/model"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/utils/logger"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/utils/responseErrors"
|
||||
"git.ma-al.com/goc_daniel/b2b/app/view"
|
||||
"golang.org/x/oauth2"
|
||||
@@ -77,6 +79,13 @@ func (s *AuthService) HandleGoogleCallback(code string) (*model.AuthResponse, st
|
||||
// Find or create user
|
||||
user, err := s.findOrCreateGoogleUser(userInfo)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "database") {
|
||||
logger.Error("google oauth callback failed - database error",
|
||||
"service", "AuthService.HandleGoogleCallback",
|
||||
"email", userInfo.Email,
|
||||
"error", err.Error(),
|
||||
)
|
||||
}
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user