mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-02 11:59:17 -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
|
# api has special rights return true if api was detected
|
||||||
def is_api?
|
def is_api?
|
||||||
current_user
|
current_user
|
||||||
@env[API_KEY]
|
@env[API_KEY_ENV]
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_auth_cookie?
|
def has_auth_cookie?
|
||||||
|
|
|
@ -130,6 +130,15 @@ describe TopicsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'api' do
|
describe 'api' do
|
||||||
|
|
||||||
|
before do
|
||||||
|
ActionController::Base.allow_forgery_protection = true
|
||||||
|
end
|
||||||
|
|
||||||
|
after do
|
||||||
|
ActionController::Base.allow_forgery_protection = false
|
||||||
|
end
|
||||||
|
|
||||||
describe PostsController do
|
describe PostsController do
|
||||||
let(:user) do
|
let(:user) do
|
||||||
Fabricate(:user)
|
Fabricate(:user)
|
||||||
|
|
Loading…
Reference in a new issue