Skip to content

Commit

Permalink
task: redirecting root to /login
Browse files Browse the repository at this point in the history
  • Loading branch information
paganotoni committed Sep 23, 2022
1 parent d833c90 commit bd7f256
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
r.Method = r.Form.Get("_method")
}

if r.URL.Path == h.prefix {
http.Redirect(w, r, path.Join(h.prefix, "/login/"), http.StatusFound)
return
}

if r.URL.Path == path.Join(h.prefix, "/login/") && r.Method == http.MethodGet {
h.login(w, r)

Expand Down

0 comments on commit bd7f256

Please sign in to comment.