FIX: Prevent 'rack.input' missing error.
This commit is contained in:
parent
1d43d7f136
commit
6ade508f39
|
@ -39,7 +39,7 @@ class Auth::DefaultCurrentUserProvider
|
|||
request = @request
|
||||
|
||||
user_api_key = @env[USER_API_KEY]
|
||||
api_key = request[API_KEY]
|
||||
api_key = @env.blank? ? nil : request[API_KEY]
|
||||
|
||||
auth_token = request.cookies[TOKEN_COOKIE] unless user_api_key || api_key
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@ describe Auth::DefaultCurrentUserProvider do
|
|||
TestProvider.new(env)
|
||||
end
|
||||
|
||||
it "can be used to pretend that a user doesn't exist" do
|
||||
provider = TestProvider.new({})
|
||||
expect(provider.current_user).to eq(nil)
|
||||
end
|
||||
|
||||
context "server api" do
|
||||
|
||||
it "raises errors for incorrect api_key" do
|
||||
|
|
Loading…
Reference in New Issue