A bunch of fixes
This commit is contained in:
1 parent
65534ecfd5
commit
2a4e03e611
20 files changed
+146
-160
No files matched your search
@@ -8,7 +8,6 @@ import (
|
||||
"uPortal/internal/auth"
|
||||
)
|
||||
|
||||
// HandleInvites lists all invite codes. Requires a super user.
|
||||
func (s *WebService) HandleInvites(w http.ResponseWriter, r *http.Request) {
|
||||
data, ok := s.basicViewData(w, r, "Invites")
|
||||
if !ok {
|
||||
@@ -26,7 +25,6 @@ func (s *WebService) HandleInvites(w http.ResponseWriter, r *http.Request) {
|
||||
s.render(w, r, "invite/view.html", data)
|
||||
}
|
||||
|
||||
// HandleInviteCreate renders the creation form on GET and mints an invite on POST.
|
||||
func (s *WebService) HandleInviteCreate(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
@@ -69,7 +67,6 @@ func (s *WebService) HandleInviteCreate(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
}
|
||||
|
||||
// HandleInviteDelete removes the invite identified by the form field "token".
|
||||
func (s *WebService) HandleInviteDelete(w http.ResponseWriter, r *http.Request) {
|
||||
if err := auth.ValidateCsrf(r, CsrfCookieName, CsrfFieldName); err != nil {
|
||||
http.Redirect(w, r, "/invites", http.StatusSeeOther)
|
||||
|
||||
Reference in new issue
Block a user