fix: remove logging from utils
This commit was merged in pull request #292.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"me-fit/log"
|
||||
"me-fit/service"
|
||||
"me-fit/template/auth"
|
||||
"me-fit/types"
|
||||
@@ -29,16 +30,15 @@ func NewHandlerAuth(service service.AuthService, render *Render) HandlerAuth {
|
||||
}
|
||||
|
||||
func (handler HandlerAuthImpl) Handle(router *http.ServeMux) {
|
||||
// Don't use auth middleware for these routes, as it makes redirecting very difficult, if the mail is not yet verified
|
||||
router.Handle("/auth/signin", handler.handleSignInPage())
|
||||
router.Handle("/api/auth/signin", handler.handleSignIn())
|
||||
|
||||
router.Handle("/auth/signup", handler.handleSignUpPage())
|
||||
router.Handle("/auth/verify", handler.handleSignUpVerifyPage())
|
||||
router.Handle("/api/auth/verify-resend", handler.HandleVerifyResendComp())
|
||||
router.Handle("/auth/verify-email", handler.HandleSignUpVerifyResponsePage())
|
||||
router.Handle("/api/auth/signup", handler.handleSignUp())
|
||||
|
||||
router.Handle("/auth/signin", handler.handleSignInPage())
|
||||
router.Handle("/api/auth/signin", handler.handleSignIn())
|
||||
|
||||
router.Handle("/api/auth/signout", handler.handleSignOut())
|
||||
|
||||
router.Handle("/auth/delete-account", handler.handleDeleteAccountPage())
|
||||
@@ -105,7 +105,7 @@ func (handler HandlerAuthImpl) handleSignIn() http.HandlerFunc {
|
||||
utils.TriggerToast(w, r, "error", "Invalid email or password")
|
||||
http.Error(w, "Invalid email or password", http.StatusUnauthorized)
|
||||
} else {
|
||||
utils.LogError("Error signing in", err)
|
||||
log.Error("Error signing in", err)
|
||||
http.Error(w, "An error occurred", http.StatusInternalServerError)
|
||||
}
|
||||
return
|
||||
@@ -305,7 +305,7 @@ func (handler HandlerAuthImpl) HandleVerifyResendComp() http.HandlerFunc {
|
||||
|
||||
_, err = w.Write([]byte("<p class=\"mt-8\">Verification email sent</p>"))
|
||||
if err != nil {
|
||||
utils.LogError("Could not write response", err)
|
||||
log.Error("Could not write response", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -370,7 +370,7 @@ func (handler HandlerAuthImpl) HandleForgotPasswordResponseComp() http.HandlerFu
|
||||
|
||||
pageUrl, err := url.Parse(r.Header.Get("HX-Current-URL"))
|
||||
if err != nil {
|
||||
utils.LogError("Could not get current URL", err)
|
||||
log.Error("Could not get current URL", err)
|
||||
utils.TriggerToast(w, r, "error", "Internal Server Error")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user