- group config/library/storage into context

This commit is contained in:
Alex Ling
2020-02-16 18:25:28 +00:00
parent d9129ad58f
commit bb936b1fa6
4 changed files with 47 additions and 34 deletions

View File

@@ -12,7 +12,7 @@ macro get_username(env)
# if the request gets here, its has gone through the auth handler, and
# we can be sure that a valid token exists, so we can use not_nil! here
cookie = {{env}}.request.cookies.find { |c| c.name == "token" }.not_nil!
(storage.verify_token cookie.value).not_nil!
(@context.storage.verify_token cookie.value).not_nil!
end
macro send_json(env, json)