mirror of
https://github.com/discourse/discourse.git
synced 2025-04-19 10:19:05 +08:00
BUGFIX: missed a key rename
BUGFIX: API spec not enabling CSRF
This commit is contained in:
parent
cf254000cf
commit
67db561429
@ -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…
x
Reference in New Issue
Block a user