Core functionality for new aiterp.net servers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
563 B

7 years ago
  1. package auth
  2. import (
  3. "net/http"
  4. "net/url"
  5. "strings"
  6. "testing"
  7. )
  8. type handlerStruct struct{}
  9. func (hs *handlerStruct) ServeHTTP(w http.ResponseWriter, req *http.Request) {
  10. req.ParseForm() // Router does this in non-tests
  11. if strings.HasPrefix(req.URL.Path, "/auth") {
  12. Handler.Handle("/auth", w, req, nil)
  13. return
  14. }
  15. }
  16. func TestHandler(t *testing.T) {
  17. auther := testAuther{FullName: "Test"}
  18. Register(&auther)
  19. form := url.Values{}
  20. form.Set("username", "Test")
  21. form.Set("password", "stuff'nthings")
  22. t.Run("Register", func(t *testing.T) {
  23. })
  24. }