23 lines
338 B
Go
23 lines
338 B
Go
package endpoints
|
|
|
|
import (
|
|
"github.com/TicketsBot/GoPanel/utils"
|
|
"github.com/gin-gonic/contrib/sessions"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func IndexHandler(ctx *gin.Context) {
|
|
store := sessions.Default(ctx)
|
|
if store == nil {
|
|
return
|
|
}
|
|
defer store.Save()
|
|
|
|
if utils.IsLoggedIn(store) {
|
|
|
|
} else {
|
|
ctx.Redirect(302, "/login")
|
|
}
|
|
}
|
|
|