Exemple #1
0
// GET root
func root(w http.ResponseWriter, r *http.Request, c *web.Context) {
	var url string
	switch c.GetRole() {
	case "admin", "employee":
		url = "/admin/home"
	case "driver":
		url = "/" + c.GetFromSession("slug").(string) + "/driver"
	default:
		url = "/login"
	}
	http.Redirect(w, r, url, 303)
}