go: redirect signed users from / to /home
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
eafc9c1e92
commit
c4f8cf87f5
@ -119,6 +119,13 @@ func Admin() echo.HandlerFunc {
|
|||||||
|
|
||||||
func Index() echo.HandlerFunc {
|
func Index() echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
return func(c echo.Context) error {
|
||||||
|
sess, _ := session.Get(setting.SessionCookieName(), c)
|
||||||
|
|
||||||
|
username := sess.Values["username"]
|
||||||
|
if username != nil {
|
||||||
|
return c.Redirect(http.StatusFound, "/home")
|
||||||
|
}
|
||||||
|
|
||||||
tpl := getTmpl("index.tmpl")
|
tpl := getTmpl("index.tmpl")
|
||||||
csrf := c.Get("csrf").(string)
|
csrf := c.Get("csrf").(string)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user