From 8b7690ef765029eecb80921df017e3ff7ba96c93 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Tue, 14 Jul 2015 20:11:25 -0700 Subject: [PATCH] don't error if api key isn't provided --- applications/api.moon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/applications/api.moon b/applications/api.moon index dfe59e45..c0d61abd 100644 --- a/applications/api.moon +++ b/applications/api.moon @@ -11,6 +11,11 @@ import find_streak from require "helpers.app" api_request = (fn) -> capture_errors_json => return fn @ if @params.key == "me" and @current_user + + assert_valid @params, { + {"key", type: "string", exists: true} + } + @key = assert_error ApiKeys\find(key: @params.key), "invalid key" @current_user = Users\find id: @key.user_id fn @