feat(security): #286 fix mail sending
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 46s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 50s

This commit was merged in pull request #300.
This commit is contained in:
2024-12-09 23:19:51 +01:00
parent eab42c26f8
commit 8cf2210aaf
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 {