INNER CODE UNIT · Go

maxage

feiyu563/PrometheusAlert · controllers/WebLogin.go:46

			maxage = 1<<31 - 1
		}
		token := fmt.Sprintf("%x", sha256.Sum256([]byte(username+password+"PrometheusAlert")))
		c.Ctx.SetCookie("username", username, maxage, "/")
		c.Ctx.SetCookie("logintoken", token, maxage, "/")
		c.Redirect("/", 301)
		return
	} else {
		//flash.Data["error"]=true
		//c.Redirect("/login",301)
		//return
		c.TplName = "login.html"
		c.Data["loginerror"] = true
		//err:=c.Render()
		//if err!=nil {
		//	beego.Error(err)
		//}
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…