示例#1
0
        public SecureModule() : base("/secure")
        {
            this.RequiresAuthentication();

            Get["/"] = x => {
                var model = new UserModel(this.Context.CurrentUser.Identity.Name);
                return View["secure.cshtml", model];
            };
        }
示例#2
0
        public PartlySecureModule()
            : base("/partlysecure")
        {
            Get("/", args => "No auth needed! <a href='partlysecure/secured'>Enter the secure bit!</a>");

            Get("/secured", args => {
                this.RequiresAuthentication();

                var model = new UserModel(this.Context.CurrentUser.Identity.Name);
                return View["secure.cshtml", model];
            });
        }