- initial commit

This commit is contained in:
Alex Ling
2020-02-11 22:06:17 +00:00
commit 3c2b054ec8
15 changed files with 324 additions and 0 deletions

15
src/auth_handler.cr Normal file
View File

@@ -0,0 +1,15 @@
require "kemal"
class AuthHandler < Kemal::Handler
exclude ["/login"]
def call(env)
return call_next(env) if exclude_match?(env)
my_cookie = HTTP::Cookie.new(
name: "Example",
value: "KemalCR"
)
env.response.cookies << my_cookie
pp env.request.cookies
end
end