Add SignInRequire and SignOutRequire middleware

This commit is contained in:
Unknown 2014-03-07 16:05:18 -05:00
parent 8e821c75d7
commit ba5c7ea771
8 changed files with 135 additions and 99 deletions

View file

@ -5,14 +5,16 @@
package routers
import (
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/routers/user"
"github.com/martini-contrib/render"
"github.com/martini-contrib/sessions"
"github.com/gogits/gogs/modules/auth"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/routers/user"
)
func Home(r render.Render, data base.TmplData, session sessions.Session) {
if user.IsSignedIn(session) {
if auth.IsSignedIn(session) {
user.Dashboard(r, data, session)
return
}