Use redis to store the sessions
This commit is contained in:
@ -139,8 +139,6 @@ func (m *Repository) PostMakeReservation(w http.ResponseWriter, r *http.Request)
|
||||
reservation.Email = form.Get("email")
|
||||
reservation.Phone = form.Get("phone")
|
||||
|
||||
// TODO: Should I check the validity of reservation.StartDate / EndDate?
|
||||
|
||||
if !form.Valid() {
|
||||
data := make(map[string]interface{})
|
||||
data["reservation"] = reservation
|
||||
@ -508,7 +506,6 @@ func (m *Repository) PostShowLogin(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Logout logs a user out
|
||||
func (m *Repository) Logout(w http.ResponseWriter, r *http.Request) {
|
||||
// TODO Use Redis to store the session. Check the documentation of scs package
|
||||
m.App.Session.Destroy(r.Context())
|
||||
m.App.Session.RenewToken(r.Context())
|
||||
http.Redirect(w, r, "/user/login", http.StatusSeeOther)
|
||||
|
Reference in New Issue
Block a user