Creating the auth handlers for the login screen
This commit is contained in:
parent
447bfc4599
commit
3e70a5727f
@ -30,6 +30,7 @@ func routes(app *config.AppConfig) http.Handler {
|
|||||||
mux.Get("/reservation-summary", handlers.Repo.ReservationSummary)
|
mux.Get("/reservation-summary", handlers.Repo.ReservationSummary)
|
||||||
mux.Get("/choose-room/{id}", handlers.Repo.ChooseRoom)
|
mux.Get("/choose-room/{id}", handlers.Repo.ChooseRoom)
|
||||||
mux.Get("/book-room", handlers.Repo.BookRoom)
|
mux.Get("/book-room", handlers.Repo.BookRoom)
|
||||||
|
mux.Get("/user/login", handlers.Repo.ShowLogin)
|
||||||
|
|
||||||
fileServer := http.FileServer(http.Dir("./static/"))
|
fileServer := http.FileServer(http.Dir("./static/"))
|
||||||
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
|
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
|
||||||
|
@ -451,3 +451,9 @@ func (m *Repository) BookRoom(w http.ResponseWriter, r *http.Request) {
|
|||||||
m.App.Session.Put(r.Context(), "reservation", res)
|
m.App.Session.Put(r.Context(), "reservation", res)
|
||||||
http.Redirect(w, r, "/make-reservation", http.StatusSeeOther)
|
http.Redirect(w, r, "/make-reservation", http.StatusSeeOther)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Repository) ShowLogin(w http.ResponseWriter, r *http.Request) {
|
||||||
|
render.Template(w, r, "login.page.tmpl", &models.TemplateData{
|
||||||
|
Form: forms.New(nil),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user