mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 14:32:44 +08:00
tweak headers so they can be consumed
This commit is contained in:
parent
206d056798
commit
3ea68f8f6c
|
@ -5,7 +5,7 @@ class Auth::DefaultCurrentUserProvider
|
||||||
|
|
||||||
CURRENT_USER_KEY ||= "_DISCOURSE_CURRENT_USER".freeze
|
CURRENT_USER_KEY ||= "_DISCOURSE_CURRENT_USER".freeze
|
||||||
API_KEY ||= "api_key".freeze
|
API_KEY ||= "api_key".freeze
|
||||||
USER_API_KEY ||= "USER_API_KEY".freeze
|
USER_API_KEY ||= "HTTP_USER_API_KEY".freeze
|
||||||
API_KEY_ENV ||= "_DISCOURSE_API".freeze
|
API_KEY_ENV ||= "_DISCOURSE_API".freeze
|
||||||
TOKEN_COOKIE ||= "_t".freeze
|
TOKEN_COOKIE ||= "_t".freeze
|
||||||
PATH_INFO ||= "PATH_INFO".freeze
|
PATH_INFO ||= "PATH_INFO".freeze
|
||||||
|
|
|
@ -174,7 +174,7 @@ describe Auth::DefaultCurrentUserProvider do
|
||||||
it "allows user API access correctly" do
|
it "allows user API access correctly" do
|
||||||
params = {
|
params = {
|
||||||
"REQUEST_METHOD" => "GET",
|
"REQUEST_METHOD" => "GET",
|
||||||
"USER_API_KEY" => api_key.key,
|
"HTTP_USER_API_KEY" => api_key.key,
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(provider("/", params).current_user.id).to eq(user.id)
|
expect(provider("/", params).current_user.id).to eq(user.id)
|
||||||
|
@ -198,7 +198,7 @@ describe Auth::DefaultCurrentUserProvider do
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
"REQUEST_METHOD" => "GET",
|
"REQUEST_METHOD" => "GET",
|
||||||
"USER_API_KEY" => api_key.key,
|
"HTTP_USER_API_KEY" => api_key.key,
|
||||||
}
|
}
|
||||||
|
|
||||||
3.times do
|
3.times do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user