2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-11 21:04:42 +08:00

Support for per-user API keys

This commit is contained in:
Robin Ward 2013-10-22 15:53:08 -04:00
parent 5e2d8dcf37
commit 348e2e3ef2
45 changed files with 670 additions and 87 deletions

View file

@ -279,7 +279,7 @@ class ApplicationController < ActionController::Base
protected

def api_key_valid?
request["api_key"] && SiteSetting.api_key_valid?(request["api_key"])
request["api_key"] && ApiKey.where(key: request["api_key"]).exists?
end

# returns an array of integers given a param key