Skip to content

Commit

Permalink
logout
Browse files Browse the repository at this point in the history
  • Loading branch information
mstgnz committed Jun 20, 2024
1 parent a955fc0 commit 6dc76cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func main() {
r.Group(func(r chi.Router) {
r.Use(webAuthMiddleware)
r.Get("/", Catch(webHomeHandler.HomeHandler))
r.Get("/logout", Catch(webUserHandler.LogoutHandler))
r.Get("/profile", Catch(webUserHandler.ProfileHandler))
// schedule
r.Get("/schedule", Catch(webScheduleHandler.HomeHandler))
Expand Down
2 changes: 1 addition & 1 deletion handler/web/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (h *UserHandler) ProfileHandler(w http.ResponseWriter, r *http.Request) err
return config.Render(w, "profile", map[string]any{})
}

func (h *UserHandler) Logout(w http.ResponseWriter, r *http.Request) error {
func (h *UserHandler) LogoutHandler(w http.ResponseWriter, r *http.Request) error {
cookie, err := r.Cookie("auth")
if err != nil {
http.Redirect(w, r, "/", http.StatusSeeOther)
Expand Down

0 comments on commit 6dc76cf

Please sign in to comment.