Created
August 8, 2016 15:10
-
-
Save anonymous/09f0284d17139010c60513864793c322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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