Skip to content

Instantly share code, notes, and snippets.

Created August 8, 2016 15:10
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 anonymous/09f0284d17139010c60513864793c322 to your computer and use it in GitHub Desktop.
Save anonymous/09f0284d17139010c60513864793c322 to your computer and use it in GitHub Desktop.
if(@session = Session[token:request.cookies['token']])
if @session.expired?
r.halt(403,{error_code:1,status:'not logged in!'})
end
else
unless r.post? && r.remaining_path == '/session/login'
r.halt(403,{error_code:1,status:'not logged in!'})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment