mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-04 00:00:51 -04:00
- initial commit
This commit is contained in:
15
src/auth_handler.cr
Normal file
15
src/auth_handler.cr
Normal 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
|
||||
Reference in New Issue
Block a user