Semaphore/api/helpers/context.go
2024-10-26 12:56:17 +00:00

13 lines
204 B
Go

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