Skip to content

Instantly share code, notes, and snippets.

@axiak
Created September 14, 2011 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axiak/1216744 to your computer and use it in GitHub Desktop.
Save axiak/1216744 to your computer and use it in GitHub Desktop.
requireLogin = (method) ->
(req, res) ->
if loggedIn
method(req, res)
else
# blargh!
class MyHandler
getUser: requireLogin (req, res) ->
@doSomething()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment