NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono

Home Page:http://nancyfx.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a nancy equivalent of flasks' decorators?

NateKomodo opened this issue · comments

Description

In flask, you can put something like @login_required over a route, and code will be run before the route, such as that of verifying the user has a specific cookie, or is logged in, and can also pass in more arguments into the method, such as a user pbject. Does nancy have an equivalent of this? If so, how do I implement it?

The docs discuss authentication including the RequiresAuthentication extension method.

https://github.com/NancyFx/Nancy/wiki/Authentication-overview