chore: extract mail to it's own service
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 45s

This commit is contained in:
2024-09-27 23:21:37 +02:00
parent ee273ed484
commit ec0e748e1f
7 changed files with 117 additions and 53 deletions

View File

@@ -73,7 +73,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
}

11
handler/auth_test.go Normal file
View File

@@ -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) {
})
}

View File

@@ -14,7 +14,7 @@ func GetHandler(d *sql.DB) http.Handler {
router.HandleFunc("/", service.HandleIndexAnd404(d))
handlerAuth := NewHandlerAuth(d, service.NewServiceAuthImpl(db.NewDbAuthSqlite(d)))
handlerAuth := NewHandlerAuth(d, service.NewServiceAuthImpl(db.NewDbAuthSqlite(d), service.NewServiceMail()))
// Serve static files (CSS, JS and images)
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))