mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
BUGFIX: missed a key rename
BUGFIX: API spec not enabling CSRF
This commit is contained in:
parent
cf254000cf
commit
67db561429
2 changed files with 10 additions and 1 deletions
|
@ -78,7 +78,7 @@ class Auth::DefaultCurrentUserProvider
|
|||
# api has special rights return true if api was detected
|
||||
def is_api?
|
||||
current_user
|
||||
@env[API_KEY]
|
||||
@env[API_KEY_ENV]
|
||||
end
|
||||
|
||||
def has_auth_cookie?
|
||||
|
|
|
@ -130,6 +130,15 @@ describe TopicsController do
|
|||
end
|
||||
|
||||
describe 'api' do
|
||||
|
||||
before do
|
||||
ActionController::Base.allow_forgery_protection = true
|
||||
end
|
||||
|
||||
after do
|
||||
ActionController::Base.allow_forgery_protection = false
|
||||
end
|
||||
|
||||
describe PostsController do
|
||||
let(:user) do
|
||||
Fabricate(:user)
|
||||
|
|
Loading…
Reference in a new issue