feat(security): #286 fix mail sending
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 39s

This commit is contained in:
2024-12-09 23:19:51 +01:00
parent eab42c26f8
commit d5d809f6b5
5 changed files with 76 additions and 32 deletions

View File

@@ -29,6 +29,16 @@ func Authenticate(service service.Auth) func(http.Handler) http.Handler {
}
}
func GetUser(r *http.Request) *service.User {
session := GetSession(r)
if session == nil {
return nil
}
return session.User
}
func GetSession(r *http.Request) *service.Session {
obj := r.Context().Value(SessionKey)
if obj == nil {