feat(security): #286 fix mail sending
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 39s
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 39s
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user