mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
Merge branch 'master' into add-formData-support
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
protect_from_forgery with: :null_session
|
||||
|
||||
wrap_parameters format: [ :json ]
|
||||
end
|
||||
|
||||
13
test-app/app/controllers/auth_tests_controller.rb
Normal file
13
test-app/app/controllers/auth_tests_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class AuthTestsController < ApplicationController
|
||||
wrap_parameters Blog
|
||||
respond_to :json
|
||||
|
||||
# POST /auth-tests/basic
|
||||
def basic
|
||||
if authenticate_with_http_basic { |u, p| u == 'jsmith' && p == 'jspass' }
|
||||
head :no_content
|
||||
else
|
||||
request_http_basic_authentication
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ class Blog < ActiveRecord::Base
|
||||
{
|
||||
id: id,
|
||||
title: title,
|
||||
content: content,
|
||||
content: nil,
|
||||
thumbnail: thumbnail
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user