diff --git a/handler/auth.go b/handler/auth.go index 0c3f79c..d48a589 100644 --- a/handler/auth.go +++ b/handler/auth.go @@ -76,7 +76,7 @@ func (handler HandlerAuthImpl) handleSignIn() http.HandlerFunc { http.Error(w, "Invalid email or password", http.StatusUnauthorized) } else { utils.LogError("Error signing in", err) - http.Error(w, "An error occurred", http.StatusInternalServerError) + http.Error(w, "InternalServerErr", http.StatusInternalServerError) } return } diff --git a/handler/auth_test.go b/handler/auth_test.go new file mode 100644 index 0000000..921902a --- /dev/null +++ b/handler/auth_test.go @@ -0,0 +1,11 @@ +package handler + +import ( + "testing" +) + +func TestHandleSignIn(t *testing.T) { + t.Parallel() + t.Run("should signIn and return session cookie", func(t *testing.T) { + }) +} diff --git a/service/auth.go b/service/auth.go index 24edf01..c431c91 100644 --- a/service/auth.go +++ b/service/auth.go @@ -400,7 +400,8 @@ func HandleDeleteAccountComp(db *sql.DB, serverSettings *types.ServerSettings) h return } - go mailService.SendMail(user.Email, "Account deleted", "Your account has been deleted") + //TODO + // go utils.SendMail(user.Email, "Account deleted", "Your account has been deleted") utils.DoRedirect(w, r, "/") } @@ -579,7 +580,8 @@ func HandleResetPasswordComp(db *sql.DB, serverSettings *types.ServerSettings) h utils.TriggerToast(w, r, "error", "Internal Server Error") return } - mailService.SendMail(email, "Reset Password", mail.String()) + //TODO + // utils.SendMail(email, "Reset Password", mail.String()) } utils.TriggerToast(w, r, "info", "If the email exists, an email has been sent") @@ -615,8 +617,8 @@ func sendVerificationEmail(db *sql.DB, userId string, email string, serverSettin utils.LogError("Could not render welcome email", err) return } - mailService := NewMailService(serverSettings) - mailService.SendMail(email, "Welcome to ME-FIT", w.String()) + //TODO + // utils.SendMail(email, "Welcome to ME-FIT", w.String()) } func TryCreateSessionAndSetCookie(r *http.Request, w http.ResponseWriter, db *sql.DB, user_uuid uuid.UUID) error {