chore: extract mail to it's own service
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 45s
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 45s
This commit is contained in:
@@ -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
11
handler/auth_test.go
Normal 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) {
|
||||
})
|
||||
}
|
||||
@@ -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/"))))
|
||||
|
||||
Reference in New Issue
Block a user