mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-27 04:07:08 +00:00
Add SignInRequire and SignOutRequire middleware
This commit is contained in:
parent
8e821c75d7
commit
ba5c7ea771
8 changed files with 135 additions and 99 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue