check / check (push) Successful in 3m23s
The webhook page and everything under it move from /source/ID to /hook/ID, the list and new-webhook form to /hooks and /hooks/new, and the event log from .../logs to /hook/ID/events, body download included. Entrypoint URLs move from /webhook/UUID to /h/UUID, and the webhook page shows only that form. The old paths are gone. Links, redirects, form actions, tests, comments and the README follow. Both links to the event log page, and its title and heading, now read "Full Event Log". Go identifiers and template file names are unchanged. A new route test posts to the entrypoint URL the webhook page shows and checks that the receiver rate limit applies to it. Model: opus-5-5
22 lines
565 B
Go
22 lines
565 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// HandleIndex returns a handler for the root path that redirects
|
|
// based on authentication state: authenticated users go to /hooks
|
|
// (the dashboard), unauthenticated users go to the login page.
|
|
func (s *Handlers) HandleIndex() http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
sess, err := s.session.Get(r)
|
|
if err == nil && s.session.IsAuthenticated(sess) {
|
|
http.Redirect(w, r, "/hooks", http.StatusSeeOther)
|
|
|
|
return
|
|
}
|
|
|
|
http.Redirect(w, r, "/pages/login", http.StatusSeeOther)
|
|
}
|
|
}
|