Semaphore/api/helpers/context.go
2024-04-12 09:23:13 +02:00

13 lines
210 B
Go

package helpers
import (
"net/http"
"github.com/ansible-semaphore/semaphore/db"
"github.com/gorilla/context"
)
func UserFromContext(r *http.Request) *db.User {
return context.Get(r, "user").(*db.User)
}