diff --git a/auth.go b/auth.go index d61d523d..8a6856d1 100644 --- a/auth.go +++ b/auth.go @@ -63,7 +63,7 @@ func (ea *EnsureAuth) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if content_type == "text/html" { - http.Redirect(w, r, "/login?next="+r.URL.Path, http.StatusSeeOther) + http.Redirect(w, r, "/signin?next="+r.URL.Path, http.StatusSeeOther) return } w.Header().Set("WWW-Authenticate", `Basic realm="Nidus Sync"`) diff --git a/endpoint.go b/endpoint.go index 2e4a4ee4..63246f54 100644 --- a/endpoint.go +++ b/endpoint.go @@ -213,6 +213,11 @@ func getServiceRequestUpdates(w http.ResponseWriter, r *http.Request) { func getSettings(w http.ResponseWriter, r *http.Request, u *models.User) { htmlSettings(w, r, u) } + +func getSignin(w http.ResponseWriter, r *http.Request) { + errorCode := r.URL.Query().Get("error") + htmlSignin(w, errorCode) +} func getSignup(w http.ResponseWriter, r *http.Request) { htmlSignup(w, r.URL.Path) } diff --git a/main.go b/main.go index 0cb8a623..bead3bb1 100644 --- a/main.go +++ b/main.go @@ -105,6 +105,7 @@ func main() { r.Get("/service-request-quick", getServiceRequestQuick) r.Get("/service-request-quick-confirmation", getServiceRequestQuickConfirmation) r.Get("/service-request-updates", getServiceRequestUpdates) + r.Get("/signin", getSignin) r.Post("/signin", postSignin) r.Get("/signup", getSignup) r.Post("/signup", postSignup)