feat(auth): #154 send verification mails

This commit is contained in:
2024-09-07 22:51:50 +02:00
parent 5172a30781
commit f6aaccc1aa
13 changed files with 353 additions and 100 deletions

View File

@@ -3,6 +3,7 @@ package service
import (
"database/sql"
"me-fit/template"
"me-fit/utils"
"net/http"
"github.com/a-h/templ"
@@ -10,8 +11,10 @@ import (
func HandleIndexAnd404(db *sql.DB) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
user := utils.GetUserFromSession(db, r)
var comp templ.Component = nil
userComp := UserInfoComp(verifySessionAndReturnUser(db, r))
userComp := UserInfoComp(user)
if r.URL.Path != "/" {
comp = template.Layout(template.NotFound(), userComp)