diff --git a/handlers/logout.go b/handlers/logout.go index e6e2339..ab4de1f 100644 --- a/handlers/logout.go +++ b/handlers/logout.go @@ -36,6 +36,13 @@ func Logout() echo.HandlerFunc { return c.Redirect(http.StatusMovedPermanently, "/logout") case c.Request().Method == "GET": + sess, _ := session.Get(setting.SessionCookieName(), c) + if sess != nil { + if username := sess.Values["username"]; username != nil { + return c.Redirect(http.StatusSeeOther, "/home") + } + } + err := c.Render( http.StatusOK, "logout.tmpl",