too much effort into the garbage

This commit is contained in:
bel
2024-03-10 10:41:31 -06:00
parent 8897142866
commit a2e84379a9
5 changed files with 128 additions and 58 deletions

View File

@@ -1,8 +1,9 @@
package server
import (
"gitea.inhome.blapointe.com/local/router"
"net/http"
"gitea.inhome.blapointe.com/local/router"
)
func (s *Server) verify(w http.ResponseWriter, r *http.Request) {
@@ -13,10 +14,8 @@ func (s *Server) verify(w http.ResponseWriter, r *http.Request) {
return
}
access := r.FormValue("access")
token, ok := s.getToken(scope, access)
if !ok {
if err := s.verifyAccess(access); err != nil {
http.Error(w, "unknown access", http.StatusUnauthorized)
return
}
w.Write([]byte(token))
}