Skip to content

Commit

Permalink
don't error if api key isn't provided
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Jul 15, 2015
1 parent 0630c36 commit 8b7690e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applications/api.moon
Original file line number Diff line number Diff line change
Expand Up @@ -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 @
Expand Down

0 comments on commit 8b7690e

Please sign in to comment.