package controllers

import (
	beego "github.com/beego/beego/v2/server/web"
)

// UserController is the controller in chrage of solr
type UserController struct {
	beego.Controller
}

// Prepare checks for logged in User
func (c *UserController) Prepare() {
	login, _ := c.GetSession("login").(string)
	if login == "" {
		c.Ctx.Redirect(302, "/login")
	}

}

// Get implements simple solr User
func (c *UserController) Get() {
	c.Data["login"], _ = c.GetSession("login").(string)
	c.TplName = "user.tpl"
}
