22 lines
402 B
Go
Executable File
22 lines
402 B
Go
Executable File
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"gitea.inhome.blapointe.com/local/router"
|
|
)
|
|
|
|
func (s *Server) verify(w http.ResponseWriter, r *http.Request) {
|
|
scope := ""
|
|
router.Params(r, &scope)
|
|
if r.Method != "POST" {
|
|
http.NotFound(w, r)
|
|
return
|
|
}
|
|
access := r.FormValue("access")
|
|
if err := s.verifyAccess(access); err != nil {
|
|
http.Error(w, "unknown access", http.StatusUnauthorized)
|
|
return
|
|
}
|
|
}
|